Managing Updates with PSWindowsUpdate

by Mar 23, 2020

There are many useful PowerShell modules available from the PowerShell Gallery. One helps you managing updates. To download and install it, run:

PS> Install-Module -Name PSWindowsUpdate -Scope CurrentUser -Force

It adds a list of new commands related to Windows Update:

PS> Get-Command -Module PSWindowsUpdate 

CommandType Name                    Version Source         
----------- ----                    ------- ------         
Alias       Clear-WUJob    PSWindowsUpdate
Alias       Download-WindowsUpdate PSWindowsUpdate
Alias       Get-WUInstall  PSWindowsUpdate
Alias       Get-WUList     PSWindowsUpdate
Alias       Hide-WindowsUpdate PSWindowsUpdate
Alias       Install-WindowsUpdate PSWindowsUpdate
Alias       Show-WindowsUpdate PSWindowsUpdate
Alias       UnHide-WindowsUpdate PSWindowsUpdate
Alias       Uninstall-WindowsUpdate PSWindowsUpdate
Cmdlet      Add-WUServiceManager PSWindowsUpdate
Cmdlet      Enable-WURemoting PSWindowsUpdate
Cmdlet      Get-WindowsUpdate PSWindowsUpdate
Cmdlet      Get-WUApiVersion PSWindowsUpdate
Cmdlet      Get-WUHistory  PSWindowsUpdate
Cmdlet      Get-WUInstallerStatus PSWindowsUpdate
Cmdlet      Get-WUJob      PSWindowsUpdate
Cmdlet      Get-WULastResults PSWindowsUpdate
Cmdlet      Get-WURebootStatus PSWindowsUpdate
Cmdlet      Get-WUServiceManager PSWindowsUpdate
Cmdlet      Get-WUSettings PSWindowsUpdate
Cmdlet      Invoke-WUJob   PSWindowsUpdate
Cmdlet      Remove-WindowsUpdate PSWindowsUpdate
Cmdlet      Remove-WUServiceManager PSWindowsUpdate
Cmdlet      Set-PSWUSettings PSWindowsUpdate
Cmdlet      Set-WUSettings PSWindowsUpdate
Cmdlet      Update-WUModule PSWindowsUpdate 

Most commands require an elevated shell to work properly but basic information is available for everyone.

PS> Get-WULastResults
WARNING: To perform some operations you must run an elevated Windows PowerShell console.

ComputerName    LastSearchSuccessDate LastInstallationSuccessDate
------------    --------------------- ---------------------------
DESKTOP-8DVNI43 22.01.2020 11:29:24   22.01.2020 11:29:52        

PS> Get-WUApiVersion
WARNING: To perform some operations you must run an elevated Windows PowerShell console.

ComputerName PSWindowsUpdate PSWUModuleDll   ApiVersion WuapiDllVersion                                                                  
------------ --------------- -------------   ---------- ---------------                                                                  
DESKTOP-8...         2.0.6995.28496  8.0        10.0.18362.387  

You are a PowerShell Professional, passionate about improving your code and skills? You take security seriously and are always looking for the latest advice and guidance to make your code more secure and faster? You’d love to connect to the vibrant PowerShell community and get in touch with other PowerShell Professionals to share tricks and experience? Then PowerShell Conference EU 2020 might be just the right place for you: (June 2-5, 2020 in Hanover, Germany).

It’s a unique mixture of classic conference with three parallel tracks filled with fast-paced PowerShell presentations, and advanced learning class with live discussions, Q&A and plenty of networking.

Secure your seat while they last: The speakers and agenda is available here:

Twitter This Tip! ReTweet this Tip!