From 9e1833282627a0184704423f4036add1be528255 Mon Sep 17 00:00:00 2001 From: Yorick Date: Thu, 26 May 2016 22:25:09 +0200 Subject: [PATCH] Some Installed KB where not detected as 'not Installed' in hide_update() --- remove-kb.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remove-kb.ps1 b/remove-kb.ps1 index 23e94b4..3c1dace 100755 --- a/remove-kb.ps1 +++ b/remove-kb.ps1 @@ -100,8 +100,9 @@ function hide_update() { param($kbList) $session = New-Object -ComObject "Microsoft.Update.Session" $searcher = $session.CreateUpdateSearcher() - #$searcher.Online = $false - $criteria = "" + $searcher.Online = $true + $searcher.IncludePotentiallySupersededUpdates = $true + $criteria = "IsInstalled=0" $result = $searcher.Search($criteria) Foreach ($kb in $kbList){ Write-Host -NoNewline -ForegroundColor White "Hide $kb : "