Created
October 19, 2019 21:34
-
-
Save privatehosting/fecb1525db2869f355b5e93985d2fadc to your computer and use it in GitHub Desktop.
PowershellScript to remove replaced or declined updates ...
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
[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | |
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer(); | |
$wsus.GetUpdates() | Where {$_.IsDeclined -eq $true} | ForEach-Object {$wsus.DeleteUpdate($_.Id.UpdateId.ToString()); Write-Host $_.Title removed } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment