-
-
Save Grimthorr/44727ea8cf5d3df11cf7 to your computer and use it in GitHub Desktop.
$UpdateSession = New-Object -ComObject Microsoft.Update.Session | |
$UpdateSearcher = $UpdateSession.CreateupdateSearcher() | |
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates) | |
$Updates | Select-Object Title |
Great this script really helps.
Hello
This script shows optional updates as well
Is there any way to exclude optional updates?
I tried using $Updates = @($UpdateSearcher.Search("IsMandatory=0").Updates)
but it throws OperationStopped: 0x80240032
error.
Thanks in advance.
You can find it like that:
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates)
$Updates | Where-Object IsMandatory -eq $true | Select Title, IsMandatory
Thanks
Thanks @fliespl! ❤️
This appears to be actually skipping optional/recommended updates. I have update preview kb5011831 pending in WU on W10LTSC 21H2 19044.1348 but it is not in the list generated by UpdateSearcher
. I've tried supplying empty criteria - still the same result. It does ignore the group policy for "skip drivers in WU" which is nice.
If u need to read from a software like Zabbix or just load in some api or application you can use this
Thanks, this was perfect!
Thanks Philip !!