Last active
October 5, 2018 19:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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