Skip to content

This module contain cmdlets to manage Windows Update Client.

License

Notifications You must be signed in to change notification settings

niStee/PSWindowsUpdate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PSWindowsUpdate

PSGallery Version PSGallery Downloads PowerShell PSGallery Platform

This module contain cmdlets to manage Windows Update Client.

Table of Contents

Release Notes

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 from the PowerShell Gallery

Install-Module PSWindowsUpdate

Usage and Examples

Import the module:

Import-Module PSWindowsUpdate

Get-WindowsUpdate / Install-WindowsUpdate

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

Add-WUServiceManager

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-WUHistory

Get Windows Update history.

Get-WUHistory

Get Windows Update Agent history for last 24h.

Get-WUHistory -MaxDate (Get-Date).AddDays(-1)

Remove-WindowsUpdate

Try to uninstall update with specific KBArticleID = KB958830.

Get-WUUninstall -KBArticleID KB958830

Get-WUSettings / Set-WUSettings

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"

Support

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.

About

This module contain cmdlets to manage Windows Update Client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%