Merge rewrite_hide_update branch

This commit is contained in:
Yorick Barbanneau 2016-01-21 15:11:15 +01:00
parent b7ef1b0951
commit 89fc25e65f

View file

@ -20,22 +20,6 @@ function hide_update() {
$searcher.Online = $false $searcher.Online = $false
$criteria = "IsInstalled=0" $criteria = "IsInstalled=0"
$result = $searcher.Search($criteria) $result = $searcher.Search($criteria)
<<<<<<< HEAD
Foreach ($update in $result.Updates) {
$found = 0
$kb | Foreach {
if ($update.KBArticleIDs -match $_) {
if (!$updates.Item($i).IsHidden) {
$update($i).IsHidden = "True"
Write-Host -ForegroundColor green "Hidden"
$found = 1
}
else {
Write-Host -ForegroundColor Yellow "Already hidden"
}
}
}
=======
Foreach ($kb in $kbList){ Foreach ($kb in $kbList){
Write-Host -NoNewline -ForegroundColor White "Hide $kb : " Write-Host -NoNewline -ForegroundColor White "Hide $kb : "
$id = $kb.Replace("KB","") $id = $kb.Replace("KB","")
@ -53,7 +37,6 @@ function hide_update() {
} }
} }
if (!$found){ Write-Host -ForegroundColor Red "Not found"} if (!$found){ Write-Host -ForegroundColor Red "Not found"}
>>>>>>> rewrite_hide_update
} }
} }
if (stop-process -name GWX -Force -ErrorAction SilentlyContinue) { if (stop-process -name GWX -Force -ErrorAction SilentlyContinue) {