Skip to content

Instantly share code, notes, and snippets.

@TScalzott
Created August 1, 2019 14:50
Show Gist options
  • Save TScalzott/022a8ff4a0c2079a170db3f7f798e7f9 to your computer and use it in GitHub Desktop.
Save TScalzott/022a8ff4a0c2079a170db3f7f798e7f9 to your computer and use it in GitHub Desktop.
Use DISM to add any missing RSAT tools.
<#
Install all missing Remote Server Administration Tools.
Windows 10 Feature Updates are reliably removing RSAT features. This script adds them back.
#>
$Caps = Dism.exe /ONLINE /GET-CAPABILITIES
$Caps | Select-String -Pattern ' : (Rsat\..*)' -Context 0, 1 |
ForEach-Object {
if ($_.Context.PostContext -match "Not Present") {
if ($_ -match ' : (Rsat\..*)') {
$command = "DISM.EXE /Online /Add-Capability /CapabilityName:$($matches[1])"
Write-Output "Invoking: $($command)"
Invoke-Expression $command
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment