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

  • Optional Updates
    2 Posts | Last post November 04, 2019
    • How can I instruct the script to also download and install optional updates?
    • is suppose you should change update settings  / give me optional updates like windows update  
  • windows server 2019
    1 Posts | Last post November 04, 2019
    • Hello your module work on windows Servers 2019 when i run script like user
      , but when i run task like  system account ( becouse i have task schedule on my servers to run windows update script) i got error  from wsus agent (invalid parametr) / on windows server 2012 R2 everythink is OK, but, on windows server 2019 i got error 
      do you have any idea WHY ? 
      interesting logs:
      X Status     KB          Size Title
      - ------     --          ---- -----
      2 Accepted   KB4516115  21 MB 2019-09 Security Update for Adobe Flash Player for Windows Server ...
      3 Failed     KB4516115  21 MB 2019-09 Security Update for Adobe Flash Player for Windows Server ...
      167 [AGENT_DOWNLOAD_STARTED]	101	{0C8661DD-4D67-404D-8095-B66D854A34F4}	200	0	<<PROCESS>>: powershell.exe	Success	Content Download	Download started.	KZAGYAOZ0UK4lgCH.
      161 [AGENT_DOWNLOAD_FAILED]	101	{0C8661DD-4D67-404D-8095-B66D854A34F4}	200	80070057	<<PROCESS>>: powershell.exe	Failure	Content Download	Error: Download failed.	KZAGYAOZ0UK4lgCH.
      80070057 error  is  bad parametr
      do you have idea WHY ? 
      thanks for any help  / i chacked also lasters version you module
  • Server-Manager & Update - GUI doesn´t refresh after Update via Script
    1 Posts | Last post October 08, 2019
    • Hi, 
      after applying the updates via script using your fantastic module the gui (Settings-Windows Update and the Servermanager) doesn´t refresh. So the Datetime at "Last installed Update" stays on the former date. Also in the Windows-Update GUI the updates still shows up. You need to click on "Install" and then they´ll disappear. Do you have any idea how to fix that for me, so my users don´t think, that no updates get installed?
      Thank you for the reply and the module.
      Best regards,
  • windows 10 1709 to 1903
    1 Posts | Last post September 27, 2019
    • Hi,
      I'm trying to update my windows 10 master with PSwindowsupate.
      I work in audit mode with a virtual machine which contains a master (windows 10 1709).
      I installed PSWindowsupdate, i can download and install several KB, but the KB4517211 fail 
      all the time (update to 1903).
      The update is accepted, ready to download, but the download is stuck at 0 and after a while it fail. I notice the size of the update (91GB).
      I know it is a bug, but my virtual disk is 35GB an i wonder if there is a test of sizing before the download.
      Any clue ?
      Thanks in advance,
  • Usage of -Criteria parameter
    1 Posts | Last post September 25, 2019
    • Hi guys
      Can anyone suggest how exactly -Criteria parameter works or what is the correct syntax to use it?
      For example, I want to filter all updates released/revised before date dd.MM.YYYY . 
      I tried to some syntax I could find in manuals like: -Criteria \"(DateRevised -le 25.03.2019)\", 
      I tried to use filed names I could find in sccm scup db: -Criteria "$_.DateRevised -le 25.03.2019"
      Unfortunately nothing worked, I always get an error and I cannot find any documentation or examples for this parameter. 
  • Inconsistent "Unknown failure"
    1 Posts | Last post September 23, 2019
    • Hi All, wonder if anyone has a constructive suggestion:
      I get frequent but intermittent errors from different PSWindowsUpdate cmdlets from different target computers, e.g.:
      + CategoryInfo          : PermissionDenied: (:) [Get-WindowsUpdate], Exception
      + FullyQualifiedErrorId : Unknown,PSWindowsUpdate.GetWindowsUpdate
      Some commands seem better e.g. Get-WURebootStatus, but others are more troublesome, e.g.: Get-WULastResults or Get-WindowsUpdate.
      Sometimes the remote target computers respond ok other times they error. Sometimes it works when an admin is logged on remotely, but that doesn't solve it consistently.
      The errors occur even with Windows Firewall disabled on both 'server' and 'client'.
      Managing server: WindowsServer2016; PSWindowsUpdate version
      Target client computers: 2016, also 2012R2, 2019;  PSWindowsUpdate version
      I installed the module on remote systems like this:
      Install-Module PSWindowsUpdate -Scope AllUsers -Force ; Import-Module PSWindowsUpdate
  • 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:
      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. ;)
1 - 10 of 352 Items