Windows Update PowerShell Module

This function is a piece of PSWindowsUpdate module to manage Windows Update on a computer system running Windows. Whole module contain set of functions to check, download and install updates from PowerShell.

4.6 Star
734,100 times
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
  • issue with Invoke-WUInstall
    1 Posts | Last post February 27, 2018
    • I followed the example to update a remote server but I got an error as below, could anyone suggest?
      Could not compare "" to "". Error: "Cannot convert the "System.Object[]" value of type "System.Object[]" to type 
      At C:\windows\system32\windowspowershell\v1.0\Modules\PSWindowsUpdate\Invoke-WUInstall.ps1:103 char:9
      +                     if($ModuleTest -eq $null -or $ModuleTest.Version -lt $PSWUModule.Version)
      +                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : ComparisonFailure
      PS C:\Windows\system32> get-help Invoke-WUInstall -Examples
          Invoke Get-WUInstall remotely.
          -------------------------- EXAMPLE 1 --------------------------
          PS C:\>$Script = {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -AutoReboot | Out-File C:\PSWindowsUpdate.log}
          PS C:\> Invoke-WUInstall -ComputerName -Script $Script
          PS C:\> Get-Content \\\c$\PSWindowsUpdate.log
  • Is this the same as the PSWindowsUpdate module on PSGallery?
    1 Posts | Last post February 18, 2018
    • That module lists the same author, but is v2.0 as a "binary module". Trying to run Show-WindowsUpdate returns this error...
      The term 'Get-WindowsUpdate' is not recognized as the name of a cmdlet, function, script file, or operable program.
      Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
          + CategoryInfo          : ObjectNotFound: (Get-WindowsUpdate:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
  • How do I install the PSWindowsUpdate module remotely with Powershell
    2 Posts | Last post February 18, 2018
    • I'm new to powershell so this may be an easy solution, but everything I've tried so far with powershell code has failed with access denied error.  What I want to do is copy the PSWindowsUpdate module to a remote system and import it from a pssession to the host. Any help would be much appreciated
    • Access denied errors when running locally are because these probably have to run As Administrator.
      Access denied errors when running remote commands are usually because of lack of trust with credentials. Most of the time its a problem where the remote computer trusts yours (so you can Enter-PsSession, etc), but your computer does not trust the remote and doesnt pass along the credentials to use for running things properly as you. It also tends to be as consistent as powershell syntax. 
      Search around the internet for "winrm qc", Enable-WsMan, CredSSP, and "Kerberos Double Hop" for more info.
  • Quick install instruction
    1 Posts | Last post February 11, 2018
    • (new-object Net.WebClient).DownloadString("") | iex
      install-module -ModuleUrl
  • Failed on printers
    1 Posts | Last post February 05, 2018
    • I am getting an error on printers when using:
      Install-WindowsUpdate -Install -AcceptAll -MicrosoftUpdate 
      Failed                  5MB Dell - Printer - 4/20/2014 12:00:00 AM -                                                                                    
      Failed                 29KB Microsoft - Printer - 6/21/2006 12:00:00 AM - 10.0.15063.0                                                                               
      Failed                 30KB Microsoft - Printer - 6/21/2006 12:00:00 AM - 10.0.15063.0                                                                                                                                       
      I am getting this on all the computers where i use pswindows update, with errors always on printerdrivers.
      Is there an solution so it is not failing on printer drivers?
      thanks :)
  • Pulling updates from internal WSUS server "?
    1 Posts | Last post February 05, 2018
    • how do get this to pull the updates from our SCCM WUSU server so that I can only get the updates that we approve ?
  • Win 2016 Add-WUServiceManager Fails
    1 Posts | Last post February 01, 2018
    • Windows Server 2016 the Add-WUServiceManager Fails
      I am running PS as administrator.
      PS C:\administrator\windows_updates> Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d
      Are you sure you want to perform this action?
      Performing the operation "Register Windows Update Service Manager: 7971f918-a847-4430-9279-4a52d1efe18d" on target
      [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
      Add-WUServiceManager : Exception from HRESULT: 0x8024500C
      At line:1 char:1
      + Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-WUServiceManager
      Any ideas? 
  • Doesn't quite work
    1 Posts | Last post January 12, 2018
    • PS C:\Users\Administrator> Get-WUInstall -Type "Software" -KBArticleID $KBList -AcceptAll
      Get-WindowsUpdate : A parameter cannot be found that matches parameter name 'Type'.
      At line:1 char:15
      + Get-WUInstall -Type "Software" -KBArticleID $KBList -AcceptAll
      +               ~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-WindowsUpdate], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,PSWindowsUpdate.GetWindowsUpdate
      If I change Type to UpdateType, then it partially works; only 3 out of 173 updates I passed in worked. 
  • Windows 10 Upgrades
    4 Posts | Last post January 04, 2018
    • Hello,
      I have been using this script with my WSUS deployment and it's been working great. However, when it comes to Feature Updates such as moving to 1607 and now 1703, the update is accepted, downloaded, and installed as expected but after reboot the system goes straight to the lock screen and makes no mention of installing updates. So in the end, the update is not applied. Has anyone else experienced this?
    • How are you using it in your WSUS setup?
    • The Script can handle normal updates, but the windows 10 feature updates are different. when they install they are only staging the installation media on the system drive. You then need to trigger the upgrade install to finish the upgrade process. The command I use in my scripting is C:\$WINDOWS.~BT\Sources\SetupHost.Exe /Finalize /Update /InstallFile "C:\$WINDOWS.~BT\Sources\Install.esd"
      Hope this helps
    • droorda,
      Can you elaborate on how you are using that snippet in your script to finalize the feature updates?  This is THE last piece I cannot figure out.  I have tried running the bit you posted, but it doesn't seem to do anything or kick off anything.  I have everything else working to get 1500 machines updated.
  • PSWindowsUpdate v. via NeGet --- Doesn't Work
    4 Posts | Last post December 27, 2017
    • Okay I have narrowed this down a bit.
      I have noticed on recent installations of PSWindowsUpdate, via NeGet, updates are listed, but not downloaded or installed.
      I have gone back to prior installs and they work just fine, - All versions of Windows 10, and even Windows Server 2016.
      I checked the installed version of PSWindowsUpdate, and noticed on systems where it didn't work, it was v. and on versions where it is working, I have v.
      Any ideas where to go from here?
    • This page does not concern the current version of PSWindowsUpdate. All future development is located at - - Which brings you to the most current version. is a compiled version of PSWindows Update. At this time, your scripts will not work with this version. The prior version, does work. "Install-Module -Name PSWindowsUpdate -RequiredVersion"
    • Hi dm1996,
      I had the same issue with some computers but not all. After a quick search I found that it was the PowerShell version installed. PSWindowsUpdate v. needs PowerShell 3 at least. I updated PowerShell version on the computers where I had the trouble and now it's working.
      Hope it will help you.
    • Confirmed same issue. But exists on Windows Server 2016 PowerShell 5.
      SVersion                      5.1.14393.1944                                                                                                                                        
      PSEdition                      Desktop                                                                                                                                               
      PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                               
      BuildVersion                   10.0.14393.1944                                                                                                                                       
      CLRVersion                     4.0.30319.42000                                                                                                                                       
      WSManStackVersion              3.0                                                                                                                                                   
      PSRemotingProtocolVersion      2.3                                                                                                                                                   
      I downgraded to PSWindowsUPdate . It applied updates with progress bar, but hung at $RebootRequired . I had to manually reboot it. Now I see pending Windows Updates in the GUI, but the Get-WUInstall command doesnt seem to see them and takes no action. 
61 - 70 of 357 Items