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
479,296 times
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
Sign in to ask a question

  • 32bit OS and Office application's Update Question
    1 Posts | Last post August 02, 2017
    • Q1: Does it run on Windows 7, Windows 10 32bit?
      Q2: Can I update Office programs?
  • Error when specifying -ComputerName
    2 Posts | Last post July 28, 2017
    • PS C:\> Get-WindowsUpdate -ComputerName testdc1
      Exception calling "CreateInstance" with "1" argument(s): "Retrieving the COM class factory for remote component with
      CLSID {4CB43D7F-7EEE-4906-8698-60DA1C38F2FE} from machine testdc1 failed due to the following error: 800706ba testdc1."
      At C:\Program Files\WindowsPowerShell\Modules\pswindowsupdate\\Get-WUList.ps1:287 char:6
      + ...             $objSession =  [activator]::CreateInstance([type]::GetTyp ...
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : COMException
      You cannot call a method on a null-valued expression.
      At C:\Program Files\WindowsPowerShell\Modules\pswindowsupdate\\Get-WUList.ps1:291 char:5
      +                 $objSearcher = $objSession.CreateUpdateSearcher()
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : InvokeMethodOnNull
    • This error means:
      The RPC server is unavailable.
      I have found that it is usually Windows Firewall causing this issue. Sometimes it is a WinRM issue so you can try creating a PSSession to see if that works if not try running the following commnad from the sever that you are trying to connect to:
      winrm qc
      Sometimes are reboot can fix it, but not usually. It could be an issue with DCOM as well. I hope this helps.
  • Why doesn't the list of downloads come?
    1 Posts | Last post July 18, 2017
    • I run the script, it gave no error but once it is done  it says "Starting installation of downloaded updates" and that is it, nothing after that. I kept on waiting for the installation but seemingly that didn't happen. Please help me out as I am in desperate need of this script to work. 
  • Can we be made available a document or link with what the commands do and few examples?
    1 Posts | Last post July 16, 2017
    • Hi, I just started using this module. It is fairly easy and well made but I would really like a document or a place in web where their functions are clearly stated.
  • -Type argument not functioning
    1 Posts | Last post July 03, 2017
    • I am using part of an example supplied by the help file - wanted to double check to make sure I am not doing something incorrect - thanks!
      PS C:\Users\Owner\Downloads\PSWindowsUpdate> Get-WUInstall -Type "Software"
      Get-WUInstall : A parameter cannot be found that matches parameter name 'Type'.
      At line:1 char:15
      + Get-WUInstall -Type "Software"
      +               ~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Get-WUInstall], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,Get-WUInstall
  • Important folder update
    1 Posts | Last post June 29, 2017
    • Hi Michal, I want to just update everything in the WindowsUpdate Important section, but I can't find any argument to do that.
      If I use: Get-WUInstall -WindowsUpdate -Category 'Crtical Updates','Security Update','Update', it update the "updates" in the optional section as well.
      I also try Get-WUInstall -WindowsUpdate -Severity important,critical.  This doesn't update everything in the Important section on WindowsUpdate.
  • No Windows logging is hapening for Windows Updates
    1 Posts | Last post June 08, 2017
    • Dear All,
      I successfully configured this tool on WSUS Server. 
      Used Commands : 
      Invoke-WUInstall -ComputerName SERVERNAME -Script {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll | Out-File C:\PerfLogs\PSWindowsUpdate.log } -Confirm:$false -Verbose
      I initiated installation of Windows Updates. Those too completed successfully.
      I am able to log the status of Installation in the mentioned out file "PSWindowsUpdate.log"
      Only issue is there is no log of Installation of those KBs in below locations : 
      1) Event log (System)
      2) Windows Update History
      The manual Update installation does log entries in above locations.
      I there anything which I am doing wrong.
      What is the possibility to get these logging enabled?
      Ashish K
  • Found [2] Updates in pre search criteria, but Found [0] Updates in post search criteria?
    2 Posts | Last post June 05, 2017
    • I’m having some issues with downloading updates via this module and wondered if anyone can help.
      When I run..
      Get-WUInstall -WindowsUpdate -MicrosoftUpdate -IgnoreRebootRequired -AcceptAll -Verbose
      I get..
      VERBOSE: Found [2] Updates in pre search criteria
      VERBOSE: Found [0] Updates in post search criteria
      And subsequently, the command installs no updates.
      The Windows Update GUI is recognising these two updates found in the above command as 'Important' updates. Can anyone advise why they are not being picked up in the post search criteria and therefore, not being installed?  
    • Answering my own question.....
      Looking at the help file again, it seems that the -IgnoreRebootRequired parameter excludes any updates in the 'post search criteria' where a reboot is required as part of the update. This is why the original two that were dfund in the pre-search crieteria where being dropped.
  • What's up with the Versioning 1.5.6 or
    1 Posts | Last post May 31, 2017
    • Change log mentions a version 1.5.6 but the main download zip says version
      Is the change log full of typos? E.g. all the 1.5.x should be 1.5.2.x?
  • Works great in Powershell, however it errors out when I try to implement via Packer (AWS)
    4 Posts | Last post May 30, 2017
    • As the subject indicates. 
      Below is the script that I'm calling:
      Install-Module PSWindowsUpdate -Force
      Import-Module PSWindowsUpdate
      Get-WUInstall -WindowsUpdate -IgnoreUserInput -AcceptAll -IgnoreReboot -Verbose | Out-File C:\Windows\Temp\PSWindowsUpdate.log
      When I run this on a running EC2 instance, it is able to download and install all available Windows updates, as expected. When I attempt to call this as a provisioned powershell script for building an AMI via Packer, it outputs the following error:
      <S S="warning">Support local instance only, Continue...</S>
      <S S="verbose">Connecting to Windows Update server. Please wait...</S>
      <S S="verbose">Found [4] Updates in pre search criteria</S>
      <S S="verbose">Found [4] Updates in post search criteria</S>
      <S S="verbose">Accept [4] Updates to Download</S>
      <S S="Error">Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))_x000D__x000A_</S>
    • I'm getting the same issue as you. Have you found a solution? 
      Im going to spend this morning troubleshooting this issue, if i find a solution i will update here
    • It appears to be causing an issue as the download cannot be called remotely via packer. 
      I found this script with uses the same module but effectively creates a task and triggers the task, causing it to be run locally. The script can be found here:
      I just updated to to get the module via PSGallery, alternatively you could just change the version number in the URL. 
      Hope that helps 
    • @MDordoy - Great find! Sorry for the delay, holiday gave me some time away from this problem.
      I tried the script you found, and I encountered a new issue:
      ==> Some builds didn't complete successfully and had errors:
      --> amazon-ebs: Retryable error: Error uploading script: Error uploading file to $env:TEMP\winrmcp-49e5c545-491a-4b20-6ec6-71cc05097378.tmp: Couldn't create sh
      ell: http response error: 401 - invalid content type
11 - 20 of 272 Items