This module contain cmdlets to manage Windows Update Client.
v2.2.1
- Set-WUSettings added params to control TargetRelease for control Feature Updates version and Windows Update for Business
- Fixed Remove-WindowsUpdate bug
- Fixed Get-WUHistory bug
- Fixed Get-WindowsUpdate sendreport bug
v2.2.0
- New cmdlet Reset-WUComponents, for reset Windows Updates components to default
- New cmdlet Get-WUOfflineMSU, for download offline msu package from microsoft Update Catalog
v2.1.1
- Remove-WindowsUpdate added WU Api uninstallation mode
- Fixed bug with slow run cmdlets
- Added support for Office 365 users to send emails
v2.1.0
- New cmdlet Set-PSWUSettings, for save PSWUSettings to xml file
- Param -SendReport can use smtp server credentials
- Install-WindowsUpdate added -RecurseCycle param, to install next updates after reboot
- Install-WindowsUpdate added new pre search criteria: DeploymentAction, IsAssigned, IsPresent, BrowseOnly and AutoSelectOnWebSites
- Change location of PSWindowsUpdate.log file to $Env:TEMP
- Fixed Get-WULastResults bugs
- Fixed Remove-WUServiceManager bugs
v2.0.0
- Rewrite whole script module to binary module
Install-Module PSWindowsUpdate
Import the module:
Import-Module PSWindowsUpdate
Get windows updates available from default service manager.
Get-WindowsUpdate
Get all available update on remote machine MG-PC, that contains in Title this two words 'Aktualizacja' and 'Windows 11' (as regular expression).
Get-WindowsUpdate -ComputerName MG-PC -MicrosoftUpdate -Title "Aktualizacja.*Windows 11" -Verbose
Hide update with KBArticleID: KB4034658.
Get-WindowsUpdate -KBArticleID KB4034658 -Hide -Verbose
...or use alias
Hide-WindowsUpdate -KBArticleID KB4034658 -Verbose
Schedule job at 6:00 PM to install update with UpdateId='ddb74579-7a1f-4d1f-80c8-e8647055314e' and RevisionNumber=200. Update will be automaticaly accepted and after all server will be automaticaly restarted if needed.
Get-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -Install -AcceptAll -AutoReboot -Verbose
...or use alias
Install-WindowsUpdate -MicrosoftUpdate -UpdateID ddb74579-7a1f-4d1f-80c8-e8647055314e -RevisionNumber 200 -ScheduleJob (Get-Date -Hour 18 -Minute 0 -Second 0) -AcceptAll -AutoReboot -Verbose
Try register Microsoft Update service as Service Manager.
Add-WUServiceManager -MicrosoftUpdate
Try register Offline Sync Service from file C:\wsusscn2.cab.
Add-WUServiceManager -ScanFileLocation C:\wsusscn2.cab
Get Windows Update history.
Get-WUHistory
Get Windows Update Agent history for last 24h.
Get-WUHistory -MaxDate (Get-Date).AddDays(-1)
Try to uninstall update with specific KBArticleID = KB958830.
Get-WUUninstall -KBArticleID KB958830
Get current Windows Update Client configuration.
Get-WUSettings
Set the target version for feature updates to Windows 10 22H2.
Set-WUSettings -TargetReleaseVersion -TargetReleaseVersionInfo 22H2 -ProductVersion "Windows 10"
I develop most of my code under open licenses, free of charge. If you are satisfied with these solutions, you can express your support for me. The greater your support, the greater the motivation to develop them further. The more motivation, the more things I can create.