Uninstalling updates
In addition to installing updates, PowerShell and the Windows update client can also uninstall updates. This is occasionally necessary when an installed update causes an unexpected result or compatibility issue.
The uninstall process for updates is similar to the installation process. The main difference here is that we are searching for only one update or a subset of updates, and then calling the UnInstall
command.
Getting ready
In this recipe, we are working with a Windows client that has installed updates. We have already identified that we wish to uninstall the update titled Update for Office File Validation 2010 (KB2553065), 64-bit Edition.
How to do it...
Carry out the following steps to uninstall the updates:
List the installed updates to identify which update will be removed:
$searcher = New-Object -ComObject Microsoft.Update.Searcher $searcher.Online = $true $searcher.ServerSelection = 1 $results = $searcher.Search('IsInstalled=1') $results.Updates | ` Select-Object...