22halomedia

Download and Install Windows Updates from the CLI With PowerShell

Subscribe to 22halomedia YouTube Channel

Introduction

Whether there is a remote machine you need to update, or you just want to update your local machine from the CLI for fun, learning how to install Windows updates using PowerShell is a useful and time-saving skill!

Open Powershell

You can open PowerShell by right-clicking the Windows Start Menu and selecting either Terminal (Admin) or PowerShell (Admin).

Allow Scripts to Run

You will need to set the execution policy on your system to allow scripts to run.

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

Install PSWindowsUpdate

Now that you can execute scripts, it’s time to install the PowerShell module PSWindowsUpdate. Enter Y when prompted for user input.

Install-Module -Name PSWindowsUpdate

Import PSWindowsUpdate

After installing PSWindowsUpdate you must install it to utilize it on your system.

Import-Module -Name PSWindowsUpdate

Display Windows Updates

Now that PSWindowsUpdates is installed and imported on your system, run the following command to see what updates are available.

Get-WindowsUpdate

Install Windows Updates

After seeing what’s available, let’s install all the updates. You can do that with the below command.

Install-WindowsUpdate -AcceptAll

Conclusion

Today you have learned how to install Windows updates using the PowerShell command line. This will undoubtedly prove useful in scenarios where you need to update a computer remotely without interrupting the user’s session. Or you can just do it for fun on your own machine!

Thank you for reading this article. If you found it helpful, please consider subscribing to our newsletter.

Additionally, if you’re considering starting an organization or business, creating a website, protecting your WordPress site from malware and cyber attacks, or are in the market for a new gaming laptop, checkout the affiliate links below! 22halomedia uses each of these products and is proudly partnered with these companies.

Affiliate Links

Form your business with Northwest registered agent

Create a website with name.com

Secure your WordPress website with Wordfence

Buy the laptop I use

Affiliate Disclaimer

Please note that my website and content may contain affiliate links. This means that when you click on these links and make a purchase, I may earn a commission. Rest assured, all the products I promote are ones that I believe to be of high quality, and I personally use them as a consumer myself. Your support through these links helps me continue to create valuable content. Thank you for your support!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *