Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active October 5, 2018 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/bdadeb1274129035cf35cf80bbb21b07 to your computer and use it in GitHub Desktop.
Save techthoughts2/bdadeb1274129035cf35cf80bbb21b07 to your computer and use it in GitHub Desktop.
You may have issues installing RSAT on Windows 10 1809 if you are using WSUS. The following block of code will address that by setting the WSUS key temporarily, installing RSAT, and then setting the key back to original
# Set variables
$registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\"
$name = "UseWUServer"
$value = "0"
$service = "wuauserv"
# Reset variables
$resetValue = Get-ItemPropertyValue -Name $name -Path $registryPath
# Set reg value and restart service
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Force | Out-Null
Restart-Service -InputObject $service -Force
# Install RSAT
Get-WindowsCapability -Online | ? Name -like 'RSAT*'| where {$_.State -eq 'NotPresent'} | foreach {Add-WindowsCapability -Online -Name $_.Name}
# Reset reg value and restart service
Set-ItemProperty -Path $registryPath -Name $name -Value $resetValue -Force | Out-Null
Restart-Service -InputObject $service -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment