I have the following code, which can find the all available Windows updates:
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0 and AutoSelectOnWebSites = 1").Updates)
$Title = $Updates.Title
$Title
This produces the below output:
2022-08 Security Update for Windows Server 2016 for x64-based Systems (KB5012170)
Windows Malicious Software Removal Tool x64 - v5.105 (KB890830)
2022-09 Cumulative Update for Windows Server 2016 for x64-based Systems (KB5017305)
2022-09 Servicing Stack Update for Windows Server 2016 for x64-based Systems (KB5017396)
Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.375.750.0)
My question is how do I filter out an update which I don't want from the list?
E.g. Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.375.750.0)