brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Get-HotFix -Id checks if a specific Windows update is installed

Windows
~/tips/tip-windows-get-hotfix-id-kb

Get-HotFix

Lists installed Windows hotfixes, or checks for one specific KB number.

When a security advisory names a KB number, I want a quick yes or no without clicking through Settings. Get-HotFix does that in one line.

Get-HotFix

It lists the hotfixes installed on the computer, with the description, the KB ID, who installed it and when. To check for one specific update, pass the ID:

Get-HotFix -Id KB957095

That KB number is the one the docs use. If the update is installed you get a row. The docs treat an empty result as not found. -Id does not accept wildcards, so give the full ID. -Description does take them:

Get-HotFix -Description "Security*"

To find the most recent one, sort by install date and take the last item:

(Get-HotFix | Sort-Object -Property InstalledOn)[-1]

Now the caveat, and it matters. The cmdlet reads the Win32_QuickFixEngineering WMI class, which only returns updates supplied by Component Based Servicing. Updates installed through the Windows Installer or through the Windows Update site are not returned. So an empty result does not prove an update is missing. Cross-check in Settings before you panic.

The cmdlet is Windows only, and the output can differ between Windows versions.

Further reading: Get-HotFix documentation

More Windows tips Win+Ctrl+C Win+Shift+Left arrow Win+Ctrl+Left arrow Alt+PrtScn Left Alt + Left Shift + Print Screen All Windows tips (33) All topics

Link