Scripts (PowerShell)

Unattended mode: How to install Microsoft PSWindowsUpdate module silently

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. If patch management is effectively performed, you can promptly address vulnerabilities of your system and mitigate any potential threats. Kindly refer to these related guides: How to update PowerShellGet and Package Management, and how to install and update PowerShell version 7 on Windows and Linux, Important Areas to Master on WSUS, Configuring WSUS Email Notification to Work With Office365, Configuring WSUS Email Notification to Work With Office365 – IIS SMTP Relay Server and how to configure SSL between WSUS servers (Upstream and Downstream Servers).

In order to orchestrate Windows Update with PowerShell, the module "PSWindowsUpdate" needs to be installed. This module contains cmdlets to manage the Windows Update Client (severs). 

This module is vital because it helps automate the deployment of Windows Update using the
- "Invoke-WUInstall" command to install Windows Updates remotely on computers or with the following below that can be configured via task scheduler to automate updates on individual computers.
- "Install-WindowsUpdate" for installing updates from Microsoft Update Center or with the 
- "Get-WindowsUpdate" to update Windows from WSUS.

This module is vital because it helps automate the deployment of Windows Update using the – “Invoke-WUInstall” command to install Windows Updates remotely on computers or with the following below that can be configured via task scheduler to automate updates on individual computers.

  • Install-WindowsUpdate” for installing updates from Microsoft Update Center or with the
  • Get-WindowsUpdate” to update Windows from WSUS.

Run the module command you wish to install silently followed by the switch “-Force” as shown below. This will install everything (the newest version) along with the required modules.

I hope you found this useful? Kindly comment on other methods below.

Subscribe
Notify of
guest

2 Comments
Inline Feedbacks
View all comments
Doug
Doug
4 months ago

Excellent article. One thing I’ve found though:

To install this module, the NuGet Package Provider must be installed first, or using the above will throw an error. For true silent install, this package provider must be installed first, using the following command:

Install-PackageProvider -Name Nuget -MinimumVersion 2.8.5.201 -Force

Christian
Christian
4 months ago
Reply to  Doug

Thank you very much for the kind words and also for sharing your knowledge with the community.

2
0
Would love your thoughts, please comment.x
()
x