Skip to content

Instantly share code, notes, and snippets.

View aaronwalker's full-sized avatar
☁️
FTaaS - Fixing things as a Service in the ⛈ and sometimes BTaaS 😉

Aaron Walker aaronwalker

☁️
FTaaS - Fixing things as a Service in the ⛈ and sometimes BTaaS 😉
View GitHub Profile
Function WSUSUpdate {
$Criteria = "IsInstalled=0 and Type='Software'"
$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 {