Windows 10 updates happen automatically or manually through the Windows Update settings. However, if you try to patch a new installation or create a custom script to automate the process, you can use commands to download and install missing patches with “PSWindowsUpdate” on PowerShell.

PSWindowsUpdate is a community module by Michal Gajda, available through the PowerShell Gallery. It includes the components to make it easy to check, download, and install quality updates on Windows 10.

In this guide, you’ll learn the steps to check and install updates for Windows 10 using PowerShell.

  • Update Windows 10 from PowerShell
  • Manage updates with PowerShell

Update Windows 10 from PowerShell

To check and install updates with PowerShell, use these steps:

  • Open Start on Windows 10.
  • Search for PowerShell, right-click the top result, and select the Run as administrator option.
  • Type the following command to install the module to run Windows Update and press Enter:
  • Install-Module PSWindowsUpdate
  • Quick note: After installing the module, you no longer need to repeat step No. 3 to use the module and manage updates.
  • Type A and press Enter to confirm.
  • Type the following command to check for updates with PowerShell and press Enter:
  • Get-WindowsUpdate
  • Type the following command to install the available Windows 10 updates and press Enter:
  • Install-WindowsUpdate
  • Type A and press Enter to confirm.

Once you complete the steps, the latest cumulative updates will download and install on your computer.

Open Start on Windows 10.

Search for PowerShell, right-click the top result, and select the Run as administrator option.

Type the following command to install the module to run Windows Update and press Enter:

Install-Module PSWindowsUpdate

Type A and press Enter to confirm.

Type the following command to check for updates with PowerShell and press Enter:

Get-WindowsUpdate

Type the following command to install the available Windows 10 updates and press Enter:

Install-WindowsUpdate

Manage updates with PowerShell

The PSWindowsUpdate module includes many options that you can use to manage updates. You can always use the Get-Command –Module PSWindowsUpdate command to query a list of the available commands.

For example, the following steps will download, install, and then reboot the computer to complete the update process:

  • Open Start.
  • Search for PowerShell, right-click the top result, and select the Run as administrator option.
  • Type the following command to download and install all the available updates and reboot the system, and press Enter:
  • Get-WindowsUpdate -AcceptAll -Install -AutoReboot

After completing the steps, Windows 10 will download and install all the available updates, rebooting the computer to apply the changes automatically.

Open Start.

Type the following command to download and install all the available updates and reboot the system, and press Enter:

Get-WindowsUpdate -AcceptAll -Install -AutoReboot

Install specific update command

To download and install a specific update on Windows 10 from PowerShell, use these steps:

  • Open Start.
  • Search for PowerShell, right-click the top result, and select the Run as administrator option.
  • Type the following command to list the available updates along with their KB numbers with PowerShell and press Enter:
  • Get-WindowsUpdate
  • Type the following command to download, install a specific update, reboot the system, and press Enter:
  • Get-WindowsUpdate -Install -KBArticleID ‘KB5021233’
  • In the command, replace “KB5021233” with the KB name of the update you want to install.

Once you complete the steps, in this case, Windows 10 will download and install update KB5021233 on your device.

Type the following command to list the available updates along with their KB numbers with PowerShell and press Enter:

Get-WindowsUpdate

Type the following command to download, install a specific update, reboot the system, and press Enter:

Get-WindowsUpdate -Install -KBArticleID ‘KB5021233’

In the command, replace “KB5021233” with the KB name of the update you want to install.

Windows 10 comes with the Windows Update Provider, but it has limited options compared to the PSWindowsUpdate module, and it’s more complicated to use.