Install Windows Updates from PowerShell (PSWindowsUpdate)

Search, download, install, and reboot into updates without opening Settings — ideal for RDP sessions and scripting.

WindowsupdatesrebootpowershellMedium risk
Install the PSWindowsUpdate module, run Get-WindowsUpdate to list pending updates, then Install-WindowsUpdate -AcceptAll -AutoReboot to install and restart.

01Command

Command
$ Install-Module PSWindowsUpdate -Force
Get-WindowsUpdate
Install-WindowsUpdate -AcceptAll -AutoReboot

02What it does

Microsoft ships no built-in cmdlet for updating Windows, so the community PSWindowsUpdate module (widely used by IT admins) wraps the official Windows Update Agent API. Get-WindowsUpdate shows pending updates with KB numbers and sizes; Install-WindowsUpdate applies them, and -AutoReboot handles the mandatory restart for you — a lifesaver when Settings' update page refuses to load over RDP or on a server without a GUI. Run it elevated; the first run also needs the module installed from the PowerShell Gallery. Use -KBArticleID KB5031234 to pin a specific patch, or omit -AutoReboot if you want to control the restart timing yourself.

03Risk

RiskMedium risk
RequirementsPowerShell as Administrator; internet access to the PowerShell Gallery and Microsoft Update
!Warning: Because it is a third-party module, install it from the official PowerShell Gallery only, and review updates with Get-WindowsUpdate before blanket-installing with -AcceptAll.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • PSWindowsUpdate
    PowerShell Gallery · community · 2026-09-17
    Evidence: Module page documenting Get-WindowsUpdate and Install-WindowsUpdate cmdlets built on the Windows Update Agent API.

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions