Keeping Windows updated is critical for performance, stability, and security. Instead of relying on the standard Windows Update interface, you can take full control with PowerShell. Using the PSWindowsUpdate module, you can search, install, and even automate updates — all from the command line.

Prerequisite

Before installing updates with PowerShell, you’ll need to allow trusted scripts to run. Open PowerShell as Administrator and run:

Set-ExecutionPolicy RemoteSigned

This enables execution of locally created and trusted scripts.

Install the PSWindowsUpdate Module

Install-Module -Name PSWindowsUpdate -Force

Import the Module

Import-Module PSWindowsUpdate

Check for Available Updates

Get-WindowsUpdate

Optional Parameters:

  • -AcceptAll → Auto-approve updates
  • -Install → Begin installation immediately

Install Updates and Reboot If Needed

Get-WindowsUpdate -AcceptAll -Install -AutoReboot

This command will install all available updates and automatically restart if required.

✅ Pro Tip: Automating this process with scheduled tasks can keep servers and workstations consistently patched without manual intervention.

Updating Windows via PowerShell

Using PowerShell to update windows has been a huge time saver for us