Skip to the content
The Update Bureau
Guide · Version Checks & PowerShell PowerShell & CLI Windows & Server

How to check, install and hide Windows updates from PowerShell

List missing updates, install a specific KB or hide an unwanted update from the terminal with PSWindowsUpdate or Windows Update's built-in COM API.

PowerShell lets you see what Windows Update is offering, install one specific update or hide an unwanted one without clicking through Settings. It is also the quickest way to do the same thing on several PCs or on a Windows Server without a desktop. There are two options: the COM object built into Windows, which needs nothing installed, and the community module PSWindowsUpdate, which is more convenient.

Run PowerShell as administrator for every command that installs or hides something.

List pending updates with the built-in COM object

Windows Update has a COM interface that any PowerShell session can use, with no download:

PowerShell
> (New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher().Search("IsInstalled=0").Updates | Select-Object Title

This asks Windows Update for everything that is not installed yet and prints the titles. The titles include the KB number, for example 2026-10 Cumulative Update for Windows 11 Version 25H2 for x64-based Systems (KB5xxxxxx). Because the search follows the PC's configuration, it shows what the PC is offered: a PC managed by WSUS or by policy sees what its server or policy allows, not everything Microsoft has published.

Useful variations:

PowerShell
# Software updates only, without drivers> (New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher().Search("IsInstalled=0 and Type='Software' and IsHidden=0").Updates | Select-Object Title# Updates you already hid> (New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher().Search("IsInstalled=0 and IsHidden=1").Updates | Select-Object Title

The COM interface can also download and install, but it takes more code. For that, the module below is easier.

Install and use PSWindowsUpdate

PSWindowsUpdate is a free module from the PowerShell Gallery, written by an independent author. It is not a Microsoft product and has no Microsoft support, but it is widely used by administrators and it only drives the same Windows Update client that Settings uses. It runs in Windows PowerShell 5.1, the one that comes with Windows, not in PowerShell 7.

PowerShell
> Install-Module PSWindowsUpdate

Answer Yes if PowerShell asks to install the NuGet provider or to trust the repository. You need an administrator session. On a managed PC, check with IT first, because installing modules from the internet may be against company policy.

See available updates

PowerShell
> Get-WindowsUpdate

It lists each pending update with its KB number, size and title, but does not install anything. To list the ones you hid, add -WithHidden.

Install one specific update

PowerShell
> Install-WindowsUpdate -KBArticleID KB5124008 -AcceptAll -IgnoreReboot

Use the KB number from the update's page on this site. -AcceptAll skips the confirmation prompts and -IgnoreReboot prevents Windows from restarting at the end, so you can choose when to restart. The update is installed but not fully active until you restart: see How to stop Windows from restarting by itself after an update to check whether a restart is pending.

Without -KBArticleID, Install-WindowsUpdate installs everything that is pending. If you only want one update, always name it.

Hide an unwanted update

PowerShell
> Hide-WindowsUpdate -KBArticleID KB5124008

PowerShell asks for confirmation, then Windows Update stops offering that update. This is the same effect as the Show or hide updates troubleshooter described in How to block or hide a single Windows update. Hide-WindowsUpdate is a shortcut for Get-WindowsUpdate -KBArticleID KB5124008 -Hide.

To show the update again, run the same command with -Hide:$false:

PowerShell
> Get-WindowsUpdate -KBArticleID KB5124008 -WithHidden -Hide:$false

As with the troubleshooter, a hidden monthly cumulative update does not protect you for long: next month's update has a different KB number.

Check the result

After installing, list what is installed with the update history:

PowerShell
> Get-WUHistory | Select-Object -First 10

or check one update directly:

PowerShell
> Get-HotFix -Id KB5124008

Get-HotFix reports only updates that are installed. If it finds nothing, the update is not installed, or it is waiting for a restart. If something goes wrong, see How to fix a Windows update that fails or gets stuck.

Edited by the site editor. Written with AI from Microsoft's own documents, checked by rules and a second AI. How we work · Report a mistake