cheat-sheets

Windows Updates

Manage Windows Update from the command line with the PSWindowsUpdate module (PowerShell Cheat-Sheet). Run in an elevated session.


PowerShell #

Install the Module #

powershell
Install-Module -Name PSWindowsUpdate

List all Commands #

powershell
Get-Command -module PSWindowsUpdate

Common Tasks #

COMMANDDESCRIPTION
Get-WindowsUpdateList available updates
Install-WindowsUpdate -AcceptAllInstall all available updates
Install-WindowsUpdate -AcceptAll -AutoRebootInstall and reboot if required
Install-WindowsUpdate -KBArticleID KB5000000Install a specific update
Get-WUHistoryUpdate history
Get-WURebootStatusIs a reboot pending?
Hide-WindowsUpdate -KBArticleID KB5000000Hide an update
Get-WindowsUpdate -ComputerName <SERVER> -AcceptAll -InstallUpdate a remote machine (see PowerShell Remote Access)
Get-WUInstallOlder alias of the install command

Built-in Tools #

COMMANDDESCRIPTION
usoclient StartScanTrigger a scan
wuauclt /detectnowLegacy scan trigger
Get-HotFixInstalled updates
sconfigServer Core menu (option 6 for updates)
DISM /Online /Cleanup-Image /RestoreHealthRepair the component store
sfc /scannowCheck and repair system files
net stop wuauserv && net stop bitsStop update services (used when resetting the cache)
Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.