Skip to content

Instantly share code, notes, and snippets.

@ab9rf
Created May 15, 2013 18:07
Show Gist options
  • Save ab9rf/5586006 to your computer and use it in GitHub Desktop.
Save ab9rf/5586006 to your computer and use it in GitHub Desktop.
$Updates = "50ff45dd-fc70-4e32-8698-a3d112e59ef1", "c0b3230a-bb79-4e44-b771-177bc224fcbf", "5f84379f-7c14-472f-b560-62a0cdec6f31", "ca2a186f-626f-401f-9cb1-68f859acbbf7"
$updatefilter = ($Updates | % { "UpdateID = '$_'" } ) -join " or "
$us = New-Object -ComObject "Microsoft.Update.Session"
$ss = $us.createupdateSearcher()
Write-Host "Scanning for IE10 updates..."
$sr = $ss.search($updatefilter)
$uninst = $False
foreach ($upd in $sr.updates) {
if ($upd.IsInstalled) { $uninst = $True }
if ($upd.IsHidden) { $status = "already hidden" }
else { $upd.IsHidden = $True; $status = "now hidden" }
Write-Host $upd.Identity.UpdateID $upd.Title $status
}
if ($uninst) {
Write-Host "Uninstalling IE10..."
wusa.exe /uninstall /quiet /norestart /KB:2718695
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment