How to install Windows 10 Updates using PowerShell Scripts

There are several ways out there to update our operating system including Windows Update, Microsoft Update Catalog, and WSUS. Each one of these processes has its own limitations and so does this method which we are going to discuss in this tutorial. However, if you love using Command-line terminals, you will surely love installing Windows 10 Updates using PowerShell Scripts. 

Well, in this method, all you require is to install a module first i.e. PSWindowsUpdate. After you install this module on your computer, you may run a simple script to automate the Windows Update process on your PC. This module not only allows installing pending updates but also supports a wide range of options like hiding buggy updates, installing Tuesday patches, and many more. Let’s explore how to use this tool in detail –

How to Get Windows 10 Updates using PowerShell

There are numerous ways out there to update Windows 10. However, in this post, we will look at how to install updates using the command-line terminal i.e. PowerShell. To do so, use these steps –

  • Press Windows Key and X to open the Power Menu.
  • Select Windows PowerShell (Admin).
  • When User Account Control prompts, hit Yes.
  • Doing so will launch the PowerShell having administrative rights.
  • On the elevated console, execute the command below –

Install-Module PSWindowsUpdate

install Windows 10 Updates using PowerShell - install PSWindowsUpdate Module

  • This code will run and ask for your permissions to install any further module. If so, type “Y” or “A” to accept it, and press Enter.

During Installation

  • Now that you have installed the required module on your PC, run this code next –

Get-WindowsUpdate

install Windows 10 Updates using PowerShell - Get Windows Update

Note: You may start getting into error messages. Worry not as this is appearing just because Microsoft doesn’t allow local PowerShell Scripts to run by default on Windows 10. However, there is a way out there to edit the required setting and re-enable installing scripts locally on your device. 

  • You will get a list of updates that are pending on your computer. 
  • Next, execute the command below –

Install-WindowsUpdate

install Windows 10 Updates using PowerShell - Install Windows Updates

  • You will be asked to give your consent before this module starts downloading and installing the pending updates on your PC. Type “A” to accept all, or Y to accept a particular request, and hit Enter.
  • The whole installing process might take several minutes depending upon your net connectivity, so wait patiently.
  • Once this is over, your PC is upgraded to the latest cumulative update. 

How to Manage Windows 10 Updates using PowerShell

Apart from updating Windows 10, the PSWindowsUpdate Module may perform a wide variety of operations. A few of them include hiding buggy updates, install app updates, download and install any specific security patch, etc. 

Note: You need to install the “PSWindowsUpdate” module only once. 

  • To download, install, and reboot your PC after installing all pending updates, use this code –

Get-WindowsUpdate -AcceptAll -Install -AutoReboot

When you execute the above code, this will look out for pending updates online, get your consent for all, install them, and at last reboot your computer.

  • Following this way, you may also look for any Tuesday patch update available for your operating system. To do so, run “Get-WindowsUpdate” first, and when you get the KB number of the latest security patch, run this code –

Get-WindowsUpdate -Install -KBArticleID 'KBNumber'

Note: Make sure to replace the KBNumber with the actual cumulative update number.

  • If you want to hide an update popping up every now and then on your device, run these two codes one after another.

Get-WindowsUpdate

Hide-WindowsUpdate -KBArticleID KBNUMBER

Tip: Make sure to replace the KBNumber with the exact cumulative update number that you get after running the first command.

I hope you find this article helpful and find it useful to install pending updates by running PowerShell Scripts. If you do have any queries or suggestions, let us know in the comment section below. 

Soni Aryan

Soni Aryan

Soni Kumari is a tech enthusiast known for her expertise in how-to type topics and Windows troubleshooting articles. She loves exploring how to do things or tweaks in Android, iPhone, and other operating systems.