Install Windows Updates from PowerShell (PSWindowsUpdate)
Search, download, install, and reboot into updates without opening Settings — ideal for RDP sessions and scripting.
01Command
$ Install-Module PSWindowsUpdate -Force
Get-WindowsUpdate
Install-WindowsUpdate -AcceptAll -AutoReboot02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- PSWindowsUpdateEvidence: 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
List installed applications that have a newer version available, then upgrade selectively.
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.