Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
The script does a good job, I’m not quite sure if this is the latest version of the script, but I noted a minor bug and some improvements that could be added.
1. Bug: $critialTitles = “”; should read: $criticalTitles = “”;
The script works anyway despite the error.
2. Putting newlines into update string: $criticalTitles += $update.Title + ” ” Changed to: $criticalTitles += $update.Title + ” `n”
3. These 3 lines are used twice in if statements and ideally would be in a function, just for neatness and brevity.
$updateSession = new-object -com “Microsoft.Update.Session” $updates=$updateSession.CreateupdateSearcher().Search((“IsInstalled=0 and Type=’Software'”)).Updates Export-Clixml -InputObject $updates -Encoding UTF8 -Path $updateCacheFile
Otherwise script works quite nicely.