Command line

How to install Windows 10 update using PowerShell

Yes, you can install the latest updates on Windows 10 using PowerShell, and this guide, you'll learn the steps to complete this task.

Windows 10 updates using PowerShell

Although updates happen automatically on Windows 10, and you can even download them through Windows Update manually, if you have to manage multiple systems, you’re trying to patch a new installation, or you want to create a custom script to automate the process in a different way, you can also use command lines to query and install missing patches with PSWindowsUpdate on PowerShell.

PSWindowsUpdate is a community module by Michal Gajda, which is available through the PowerShell Gallery, and 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.

How to update Windows 10 using PowerShell

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

  1. Open Start.

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

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

    Install-Module PSWindowsUpdate
    Install-Module PSWindowsUpdate
    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.
  4. Type A and press Enter to confirm.

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

    Get-WindowsUpdate
  6. Type the following command to install the available Windows 10 updates and press Enter:

    Install-WindowsUpdate

    PowerShell install Windows 10 updates
    PowerShell install Windows 10 updates
  7. Type A and press Enter to confirm.

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

Manage updates with PowerShell

The PSWindowsUpdate module includes a lot of 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 download, install, and then reboot the computer to complete the update process:

  1. Open Start.

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

  3. 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 you complete the steps, Windows 10 will download and install all the available updates, and it’ll reboot the computer to apply the changes automatically.

There’s also the option to download and install an specify update:

  1. Open Start.

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

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

    Get-WindowsUpdate
    
  4. Type the following command to download and install specific and reboot the system and press Enter:

    Get-WindowsUpdate -Install -KBArticleID 'KB4560960'

    In the command, make sure to replace “KB4560960” with the KB name of the update that you want to install.

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

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.