diff --git a/remove-kb.ps1 b/remove-kb.ps1 index b5acf2b..7feea52 100755 --- a/remove-kb.ps1 +++ b/remove-kb.ps1 @@ -55,11 +55,7 @@ function remove_tasks () { Write-Host -Nonewline -ForegroundColor white " Error " } Write-Host -ForegroundColor green "Done" - - } - Write-Host -ForegroundColor Green " Done" - } - else { Write-Host -ForegroundColor Yellow " Already removed"} + else { Write-Host -ForegroundColor Yellow " Already removed" } } } @@ -86,12 +82,12 @@ function hide_update() { } } } - if (!$found){ Write-Host -ForegroundColor Red "Not found"} + if (!$found){ Write-Host -ForegroundColor Red "Not found" } } } Write-Host -Nonewline -ForegroundColor white "Searching for GWX process ... " -if (Get-Process -name GWX -ErrorAction SilentlyContinue}) { +if (Get-Process -name GWX -ErrorAction SilentlyContinue) { Write-Host -ForegroundColor DarkGreen -NoNewLine "Running " Write-Host -Nonewline -ForegroundColor white "removing ... " Try {Stop-Process -name GWX -Force -ErrorAction SilentlyContinue} @@ -103,7 +99,7 @@ else { Write-Host -ForegroundColor Yellow ("Not running")} takeown /F "$env:WINDIR\System32\GWX" /R /D $yes 2>&1 | Out-Null icacls "$env:WINDIR\System32\GWX" /C /grant $adminGroup":F" /T 2>&1 | Out-Null Try{ Remove-Item $env:WINDIR\System32\GWX\* -Force -Recurse -ErrorAction SilentlyContinue} -Catch {Write-Host -ForegroundColor Red "Some files can't be deleted."} +Catch {Write-Host -ForegroundColor Red "Some files can't be deleted."} Foreach($kbID in $kbIDs){