Skip to content

Instantly share code, notes, and snippets.

@DanielRuskin1
DanielRuskin1 / wsus-update.ps1
Last active April 24, 2016 18:07 — forked from jacobludriks/wsus-update.ps1
wsus-update
Function WSUSUpdate {
$Criteria = "IsInstalled=0 and BrowseOnly=0"
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
try {
$SearchResult = $Searcher.Search($Criteria).Updates
if ($SearchResult.Count -eq 0) {
Write-Output "There are no applicable updates."
exit
}
else {