Monday, December 12, 2016

Advanced Tip: Finding and Uninstalling a HotFix From PowerShell

Warning: Use this trick at your own risk, uninstalling the wrong hot fixes on your system can cause problems.

There are several ways to find the hotfixes from the GUI tools on your system, such as the Windows Update GUI.  I generally like to use PowerShell only tricks, but this one is a hybrid. It uses a utility called WUSA to uninstall the hotfix.

To uninstall a hotfix on your system, you need to know its KB number.  You can use this technique to test if it exists and then uninstall it. All you have to do is change the KB number in the $A variable.

$a="11111111";$b="KB"+$a;$c=Get-HotFix|Where-Object HotFixID -eq $b;if(![string]::IsNullOrEmpty($c)){wusa /uninstall /kb:$a}

No comments: