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
(354)
722,517 times
Add to favorites
Windows Update
4/4/2017
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • LocalPSWUSource
    3 Posts | Last post September 10, 2019
    • I am trying to deploy the module remotely, and when i do i get the error below.  I am looking at the parameter in the script and dont really know what to do with this error.  I have fixed a few other issues, like getting to run in SSL, but cannot figure out what to do for this error, hoping someone has had this issue and can provide some guidance.  
      
      Update-WUModule : A parameter cannot be found that matches parameter name 'LocalPSWUSource'.
      At C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\invoke-wuinstall.ps1:111 char:48
      + ...   Update-WUModule -ComputerName $Computer    -LocalPSWUSource (Get-Mo ...
      +                                                  ~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [Update-WUModule], ParameterBindingException
          + FullyQualifiedErrorId : NamedParameterNotFound,PSWindowsUpdate.UpdateWUModule
    • figured it out
      
      [String]$LocalPSWUSource = "C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate",
    • steak 1986, how did you get SSL running?
  • Returning To Variables
    1 Posts | Last post September 06, 2019
    • The output for the command had 3 different lines for KBs. One for Accepted, one for Download, One for Install:
      X ComputerName Result     KB          Size Title
      - ------------ ------     --          ---- -----
      1 SHLW3265     Accepted   KB4511555   59MB XXX
      2 SHLW3265     Downloaded KB4511555   59MB XXX
      3 SHLW3265     Installed  KB4511555   59MB XXX
      
      However, if you write to a variable ($install = Install-WindowsUpdates) and echo the variable you get three lines all saying installed.  Has anyone been able to parse it similar to the output results:
      X ComputerName Result     KB          Size Title
      - ------------ ------     --          ---- -----
      3 SHLW3265     Installed  KB4511555   59MB XXX
      3 SHLW3265     Installed  KB4511555   59MB XXX
      3 SHLW3265     Installed  KB4511555   59MB XXX
      
      Or do I just not know what I am doing.
  • Latest PSWindowsUpdate Version
    1 Posts | Last post September 05, 2019
    • The latest versions can be found at the PowerShell Gallery home page for this module:
      
      https://www.powershellgallery.com/packages/PSWindowsUpdate/
      
      Of course, running <inmo PSWindowsUpdate> should normally install the latest version at the time of invocation.  Don't forget to import afterwards with <ipmo PSWindowsUpdate> as inmo (alias for import-module) simply downloads the module to the default PowerShell module directory.
      
      Not sure why this page isn't being updated anymore. :(
  • Newbie - 2 Questions
    2 Posts | Last post September 05, 2019
    • Hello.
      I am quite new to these scripts. I have three questions. Hope they can answer with someone.
      I want to run ALL updates & restarts every Sunday at 03:00 if necessary.
      
      Question 1)
      Have I read the instructions correctly?
      #Get-WUInstall -WindowsUpdate -IgnoreUserInput -WhatIf -Verbose -AcceptAll –AutoReboot
      
      Question 2)
      Sometimes someone forgets to log off a user. Is there a "Force" command for restarting?
      
      Question 3)
      Server A need "Get-WUInstall -MicrosoftUpdate"
      Server B need "Get-WUInstall -WindowsUpdate" (MicrosoftUpdate isn´t working)
      I never noticed it before! Where can this be unified?
      
      Thank you, Lars
    • Answer 1)
      I think you need to use Invoke-WUJob for scheduled updates.  This is also the proper technique for updating remote machines from your local admin PowerShell console.  Otherwise, almost on your Get-WUInstall line.  Add the -install switch to make sure they do install.
      Answer 2)
      I'm fairly certain that autoreboot will force the reboot even on active interactive sessions, e.g. it seems to be similar to the <Restart-Computer -force> command.
      Answer 3)
      If Microsoft Update isn't working, you might try to use the DISM tool, SFC /scannow, and possibly even the WMI diagnostic tool to get that working.  Even if you don't necessarily need it to work, it's good practice to utilize the aforementioned tools for experience and skill building. ;)
  • What special permission is required for invoke-wujob on remote computer?
    1 Posts | Last post September 04, 2019
    • I am trying to install update on remote computer using invoke-wujob. I am able to use invoke-command to launch get-windowsupdate to obtain the available updates on the remote computer (server 2016). However, when I tried using invoke-wujob to launch get-windowsupdate (not try to install yet) and it failed with the following message. Does anyone know what specific permission I need for the invoke-wujob cmdlet.
      
      + CategoryInfo          : OperationStopped: (dell-sm:String) [Invoke-WUJob], PSRemotingTransportException
      + FullyQualifiedErrorId : JobFailure,PSWindowsUpdate.InvokeWUJob
      + PSComputerName        : server1
      
      worked
      invoke-command -computername server1 -cred ${get-cred) -scriptblock {get-windowsupdate}
      failed
      invoke-wujob -runnow -computername server1 -cred $(get-cred) -script {get-windowsupdate}
      
      Thanks
  • invoke-wuinstall : the term 'invoke-wuinstall' is not recognized
    2 Posts | Last post August 20, 2019
    • I have imported the PSwindowsupdate module, but when try to access the invoke-wuinstall module i am getting its not a recognized command. Can you please help on this? 
    • Its Invoke-WUJob now.
  • External tools like WuInstall
    2 Posts | Last post July 19, 2019
    • I am not so great at scripting but I consider using a command line tool for searching and installing updates via command line / simple powershell scripts - stumbled over WuInstall (http://www.wuinstall.com) - does any one of you have any experience with that one, is it useful for production environments?
      Or do you recommend to powershell-script it ourselves as opposed to external tools?
    • Hi, we are using WuInstall and it works great for us!  They recently posted a step by step guide on how to force Windows 10 updates to install using the command line. 
      http://wuinstall.donkeycat.com/index.php/blog-list/item/11-force-windows-10-updates-command-line.html
  • Error Message when using Install-WindowsUpdate
    1 Posts | Last post July 19, 2019
    • Environment: Domain 
      GPO and Firewall Policies allow WinRM (http://technico.qnownow.com/the-winrm-client-cannot-process-the-request-if-the-authentication-scheme-is-different/) and (https://www.kjctech.net/how-to-enable-winrm-with-domain-group-policy-for-powershell-remoting/)
      
      Getting the following below:
      Install-WindowsUpdate : [CVWCSX6] Connecting to remote server CVWCSX6 failed with the following error message : The WinRM client cannot process the request.  Default credentials with Negotiate over HTTP can be used only if the target machine is part of the TrustedHosts list or the Allow implicit credentials 
      for Negotiate option is specified. For more information, see the about_Remote_Troubleshooting Help topic.
      At line:1 char:1
      + Install-WindowsUpdate -ComputerName CVWCSX6 -MicrosoftUpdate -AcceptA ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : OpenError: (CVWCSX6:String) [Get-WindowsUpdate], PSRemotingTransportException
          + FullyQualifiedErrorId : ExplicitCredentialsRequired,PSSessionStateBroke
      
      
      Get-WUInstall seems to work - shows list but doesn't seem to install the updates
      Get-WUInstall -ComputerName CVWCSX6 -AcceptAll -SendReport 
      
  • The update could not be uninstalled because..
    1 Posts | Last post June 26, 2019
    • I am getting the following error when I try to remove KB's. 
      
      PS C:\windows\system32> Uninstall-WindowsUpdate -KBArticleID KB4462223 -Confirm:$false -Verbose
      VERBOSE: Performing the operation "(6/25/2019 2:04:59 PM) Remove (WUApi) Windows Update: Security Update for
       Microsoft Office 2010 (KB4462223) 32-Bit Edition" on target "OEM1211".
      WARNING: Exception from HRESULT: 0x80240028. The update could not be uninstalled because the request did not
       originate from a WSUS server.
      
      
      
      All of my Updates have came down via Windows update (No WSUS).
      
      Anybody seen this issue?
      
      PSwindowsupdate 2.1.1.2
  • 1.) Why update not listed when using PSWindowsUpdate? / 2.) Filter for a specific update using PSWindowsUpdate?
    3 Posts | Last post May 25, 2019
    • Hi,
      
      I’ve seen that OEMs like HP are also offering BIOS updates within the Microsoft Update Catalog.
      In my example I’m using a HP EliteBook 840 G5 which contains the BIOS version 01.04.00 (=not the latest).
      
      This BIOS version 01.04.00 and the latest one 01.06.00 is also available within the Microsoft Update Catalog,
      when using either the hardware ID of the firmware (=BIOS) listed under Windows Device Manager (“Firmware” -> “System Firmware” -> “Properties” -> “Details” -> “Hardware Ids”) or the so called family ROM name “Q78” as a search term:
      - Search term hardware ID (“854bef26-b844-4f03-8e09-b64b4b1ee21e”)”: https://www.catalog.update.microsoft.com/Search.aspx?q=854bef26-b844-4f03-8e09-b64b4b1ee21e
      - Search term family ROM name (“Q78”): https://www.catalog.update.microsoft.com/Search.aspx?q=Q78
      
      I want to use the Powershell module PSWindowsUpdate (https://www.powershellgallery.com/packages/PSWindowsUpdate/) for downloading a specific update,
      like this latest BIOS version 01.06.00  for the HP EliteBook 840 G5 from the Microsoft Update Catalog.
      However, if I use one of the following commands it’s not listed at all despite the HP EliteBook 840 G5 unit still contains the older BIOS version 01.04.00:
      Get-WUInstall -MicrosoftUpdate
      Get-WUList -MicrosoftUpdate
      
      
      Here the complete list of commands I’ve used to install the module PSWindowsUpdate,
      before using one of the two commands mentioned above (also see the following tutorial: https://www.petri.com/manage-windows-updates-with-powershell-module):
      Install-Module -Name PSWindowsUpdate
      Set-ExecutionPolicy RemoteSigned
      Import-Module PSWindowsUpdate
      Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d
      
      So 1st question specific to this update is, why it’s not listed when using PSWindowsUpdate at all?
      And the 2nd one, how to filter for a specific update using PSWindowsUpdate if it doesn’t contain a KB (parameter –KBArticleID)?
      
      
      
      Thanks and best regards
    • Not really an answer, but I'm trying to use the latest version of this module and sometimes it just doesn't find all the updates. 
      Most recently, there is an KB update for 1809, to prepare WU for 1903 - it's called Cumulative Update... - can't remember the KB number, sorry. And the module won't find it. 
      What's interesting, if you manually search for updates in normal W10 interface, it will show and start downloading. And then if you run the module, it will suddenly find that update...
    • KB4497934 it is IIRC
1 - 10 of 346 Items