Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows » How to apply Windows Updates with PowerShell
  • How to Enable & Disable CTRL + ALT + DEL Secure Login on Windows 11
    How to Enable/Disable CTRL + ALT + DEL Secure Login on Windows 11/10 Windows
  • tux through window 620x354 1
    WSL Error 0x8007019e: WSL Register Distribution failed with error Windows
  • powershell01
    WinRM and PSRemoting: Configure servers for remote access Scripts
  • sign11
    Windows sign-in options and account protection on Windows 11 Windows
  • SU
    How to switch users in Linux Linux
  • RDP
    The connection was denied because the user is not authorized for remote Login: Enable Remote Desktop Connection on Windows 11 for non-administrators or selected users Windows
  • MBAM Client
    How to Check if MBAM Agent is installed on Windows PC Windows
  • images 1 1
    How To Use Pleasant Password Private Folder Password Manager

How to apply Windows Updates with PowerShell

Posted on 23/03/202222/02/2025 Christian By Christian No Comments on How to apply Windows Updates with PowerShell
Applying Windows Updates

In this article, w shall learn how to apply Windows Updates with PowerShell. Microsoft Windows provides its own patch management solution referred to as Windows Update. Having a proper grip of these updates is paramount for your production workflow as they often start automatically during business hours resulting in downtime. Please see How to setup PowerShell on a Linux server, how to Fix Windows cannot check for updates in Windows 8, 7, and 10, and how to install and update PowerShell version 7 on Windows and Linux.

With PowerShell cmdlets, you can automate Windows updates, saving you effort and time. With the right patch management solution, you can enhance your system by testing or installing the latest software updates and patches.

Patches are temporary fixes for existing issues between full-scale software releases. Effective patch management enables prompt vulnerability addressing and threat mitigation for your system.

However, See these guides: How to automate Windows Update with PowerShell and Task Scheduler, and how to install Microsoft PSWindowsUpdate module silently.

How to install PSWindowsUpdate

It is worth noting that PSWindowsUpdate is a third-party module that is not integrated into Windows by default. This module can be downloaded from the PowerShell gallery, the most used repository for sharing PowerShell code.

Screenshot 2022 03 23 at 20.56.02

This module includes different cmdlets to manage the deployment of Windows updates from the command line. Download the PSWindowsUpdate version from the PowerShell Gallerry. 

Screenshot 2022 03 23 at 20.57.54

Next, we will have to install the PSWindowsUpdateModule as shown below. If the PowerShell setup is already configured to allow online downloads, the PSWindowsUpdate module can also be installed directly from the online repository (PSGallery) running the command below.

 Install-Module -Name PSWindowsUpdate

Note: You may need to open an elevated PowerShell prompt and run Set-ExecutionPolicy RemoteSigned to allow the execution of scripts signed by a trusted publisher.

Nonetheless, You may also want to do this via Windows Settings. However, This is because PowerShell is configured to prevent the execution of PowerShell scripts on Windows systems by default.

Install-Module-PSWindowsUpdate-Force

Master how to apply Windows Updates with PowerShell for streamlined maintenance. Furthermore, Don’t miss out on optimizing your system’s performance.

Commands in PSWindowsUpdate

Installed aliases and cmdlets can be displayed by typing Get-Command–module PSWindowsUpdate.

module-PSWindowsUpdate

A brief description of principal commands is described below:

  • Get-WindowsUpdate: At the heart of this module lies the primary cmdlet for efficient management. Nonetheless, It effortlessly compiles, downloads, and installs necessary updates, all while allowing you to define prerequisites. Plus, you can exercise control over restart protocols if you apply Windows Updates with PowerShell.
  • Remove-WindowsUpdate: Uninstalls an update.
  • Add-WUServiceManage: Registers a new Windows Update API Service Manager
  • Get-WUHistory: Shows a list of installed updates
  • Get-WUSettings: Gets Windows Update client settings
  • Get-WUInstallerStatus: Gets Windows Update Installer Status (busy or not)
  • Enable-WURemoting: Enables firewall rules for PSWindowsUpdate remoting
  • Invoke-WUJob: Invokes PSWindowsUpdate actions remotely

Install Windows Updates

For Updates directly from the Microsoft update center, use the command below.

Get-WUInstall –MicrosoftUpdate –AcceptAll –AutoReboot
Get-WUInstall-–MicrosoftUpdate-–AcceptAll-–AutoReboot

Install Updates from WSUS

For WSUS updates, the following commands work correctly.

Get-WindowsUpdate -install -AcceptAll -AutoReboot
WindowsUpdate-install-AcceptAll-AutoReboot

However, You may want to see this guide on creating a scheduled task. For Task Scheduled task error and success code.

I trust you discovered valuable insights in this blog post about How to apply Windows Updates with PowerShell. Moreover, Feel free to share your queries or thoughts in the comments section.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Windows Tags:PowerShell, updates, Windows 10, Windows 11, Windows Server 2016, Windows Updates

Post navigation

Previous Post: How to install Let’s Encrypt on Apache Web Server
Next Post: How to install Node.js on Ubuntu

Related Posts

  • VMware workstation networking issues
    Network cable Unplugged: Fix VMware “Warning – Multiple default gateways are intended to provide redundancy to a single network Virtualization
  • Retieve BitLocker Recovery Keys from microsoft sql
    Get MBAM BitLocker Recovery Keys from Microsoft SQL Server Windows
  • How to Install RSAT on Windows 11
    How to Install and Uninstall RSAT on Windows 11 Windows
  • How to create a dev drive
    How to create a Dev Drive on Windows 11 Windows
  • How to create blue screen using the Not my Fault tool from Sysinternals
    How to create blue screen using the Not my Fault tool from Sysinternals Windows
  • FQWD
    Logoff or Restart or Shutdown Windows PC remotely Windows

More Related Articles

VMware workstation networking issues Network cable Unplugged: Fix VMware “Warning – Multiple default gateways are intended to provide redundancy to a single network Virtualization
Retieve BitLocker Recovery Keys from microsoft sql Get MBAM BitLocker Recovery Keys from Microsoft SQL Server Windows
How to Install RSAT on Windows 11 How to Install and Uninstall RSAT on Windows 11 Windows
How to create a dev drive How to create a Dev Drive on Windows 11 Windows
How to create blue screen using the Not my Fault tool from Sysinternals How to create blue screen using the Not my Fault tool from Sysinternals Windows
FQWD Logoff or Restart or Shutdown Windows PC remotely Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • How to Enable & Disable CTRL + ALT + DEL Secure Login on Windows 11
    How to Enable/Disable CTRL + ALT + DEL Secure Login on Windows 11/10 Windows
  • tux through window 620x354 1
    WSL Error 0x8007019e: WSL Register Distribution failed with error Windows
  • powershell01
    WinRM and PSRemoting: Configure servers for remote access Scripts
  • sign11
    Windows sign-in options and account protection on Windows 11 Windows
  • SU
    How to switch users in Linux Linux
  • RDP
    The connection was denied because the user is not authorized for remote Login: Enable Remote Desktop Connection on Windows 11 for non-administrators or selected users Windows
  • MBAM Client
    How to Check if MBAM Agent is installed on Windows PC Windows
  • images 1 1
    How To Use Pleasant Password Private Folder Password Manager

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.