Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
shades4321
byshades4321, October 18, 2015
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.
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.