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


  • This is deprecated!!
    1 Posts | Last post September 14, 2018
    • Why is there no link to the 2018 versions of PSWindowsUpdate?
      
      https://www.powershellgallery.com/packages/PSWindowsUpdate/2.0.0.4
      
      This is an old version. Can we retire this page and redirect to the other site?
  • [US-TV]!! Arizona vs Houston 2018 Live Stream NCAAF Game Watch College Football Online Web HD TV Telecast
    1 Posts | Last post September 08, 2018
    • Arizona vs Houston Live Natives natives co uk Videos Events 5 hours ago Arizona vs Houston Live video on Natives Houston vs Arizona Live Score Today 
      
      ===================
      
      watch live: http://ustv24.com/ncaaf-tv/
      
      ===================
      
      Houston vs Arizona Live Stream Free Houston vs Arizona Arizona Wildcats vs Houston Cougars  Live score updates TV   oregonlive com sports index ssf arizona wildcats vs houston co html 10 hours ago Kevin Sumlin and the Arizona Wildcats look to rebound from a Week 1 loss to BYU with a road trip to Houston to take on the Cougars Saturday Arizona vs Houston  5 Houston to watch Arizona Desert Swar  azdesertswarm com arizona vs houston 5 cougars to watch wildcats ol 2 days ago After a rough 28 23 opening loss to BYU the Arizona Wildcats head to Texas for a 9 a m MST kickoff against the Houston Cougars Despite their status as a Group of 5 team Houston has plenty of talented players on their roster and they beat Arizona in Tucson last year albeit Arizona vs Houston live TV Channel Facebook  facebook com events 261277584717122 azdesertswarmcomarizona vs houston 5 cougars to watch wildcats ol 2 days ago After a rough 28 23 opening loss to BYU the Arizona Wildcats head to Classifieds (Watch LIVE)Arizona Wildcats vs Houston Cougars Live   discoverweyburn com 4551 watch live arizona wildcats vs houston c 45 mins ago Arizona Wildcats vs Houston Cougars  Live score updates TV channel how to watch live stream Arizona vs Houston  5 Houston to watch Classifieds Arizona Wildcats vs Houston Cougars Live S
  • Integrating PSWindowsUpdate with DSC
    2 Posts | Last post August 23, 2018
    • Crossposted from powershellgallery.com/packages/PSWindowsUpdate where there is more information. 
      
      I created a custom Desired State Configuration resource module that utilizes PSWindowsUpdate version 1.4.x and it has worked well for over a year now. I wanted to take advantage of the new features in version 2.0.0.4, but I am running into a strange error that I hope someone can help me with. 
      
      Here is my DSC code: https://pastebin.com/8nxQBmzb
      
      As you can see from the code, the Test phase runs Get-WUList and will return false if updates are found. The Set phase runs Get-WUInstall -Install –AcceptAll –IgnoreReboot -Verbose.
      The error occurs during the Set phase. In my example log below, the module finds 2 updates in the pre search criteria and 2 updates in the post search criteria. The module is able to accept both updates, but only downloads and installs one of the updates, which is expected. After the one update gets installed (it really does get installed), this error shows:
      
      A command that prompts the user failed because the host program or the command type does not support user interaction. 
      Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, 
      and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell 
      workflows.
          + CategoryInfo          : NotImplemented: (:) [], CimException
          + FullyQualifiedErrorId : HostFunctionNotImplemented,PSWindowsUpdate.GetWindowsUpdate
          + PSComputerName        : MYSERVERNAME.domain.com
      
      The little bit of research I've done suggests that the Get-WUInstall command is prompting for user input or maybe write-host is called somewhere in the code after the update is installed. Since this version of the module is a compiled DLL, I can't check the code to troubleshoot it, hence why I'm asking here. I'm hoping the original author or one of the maintainers can help me troubleshoot this issue
    • I ran into this as well just this week while creating a custom DSC resource for patching.  The module is definitely asking for user input.  You can replicate it by running Get-WURebootStatus when the machine is pending a reboot.  I found the trick was to find what commands check for reboots and then silencing their output.  Below are the commands I've found so far that needed this and the argument(s) that allow them to run in DSC: 
      Get-WURebootStatus -Silent
      Install-WUUpdate -IgnoreReboot
      Get-WUinstall -Install -IgnoreReboot
  • Update a VHD
    1 Posts | Last post August 21, 2018
    • Hello all,
      
      I would like to use this module on a vhd file. Do you think it's possible ?
      Example : 
      $mountedVHD = Mount-VHD –Path c:\myVM.vhdx
      Get-Wuinstall $mountedVHD 
      
      Thank you for your help.
  • Access is denied error.... on remote PC
    1 Posts | Last post August 17, 2018
    • error....
      
      cmd...
      
      Install-WindowsUpdate –MicrosoftUpdate -Verbose -Category 'Critical Up
      dates', 'security updates' -IgnoreReboot –AcceptAll
      
      
      error...
      
      
      VERBOSE: Accepted [12] Updates ready to Download
      Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
          + CategoryInfo          : NotSpecified: (:) [Get-WindowsUpdate], UnauthorizedAccessException
          + FullyQualifiedErrorId : System.UnauthorizedAccessException,PSWindowsUpdate.GetWindowsUpdate
  • Windows Update on Standalone Workstations !!!
    2 Posts | Last post August 06, 2018
    • Hi all PowerShell Gurus …
      
      I'm trying to Windows Update  Standalone workstations from Bits from an USB Key.
      
      Here is the way I try to get it works:
      - $WUOfflineSync = Add-WUOfflineSync -Path %USB%\Updates\Microsoft\WSUSScn2.Cab -Name 'Bla Bla' -AcceptAll
      - $WUInstall = Get-WUInstall -ServiceID $WUOfflineSync.ServiceID -AcceptAll
      
      All look like it working but no update are installed …
      I have almost 39 updates on my USB but no way to lanch any of it …
      
      Any help ?
      
      Regards,
      
    • I got 2 different status : Accepted or Failed but no updates installed ...
      
      2 Accepted   KB2565063  18 MB Mise à jour de sécurité pour le package redistribuable Microsoft Visual C++ 2010 Service Pack 1 (KB2...
      2 Accepted   KB2862152   1 MB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2862152)                   
      2 Accepted   KB2862330 388 KB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2862330)                   
      2 Accepted   KB2871997  13 MB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2871997)                   
      2 Accepted   KB2973351   5 MB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2973351)                   
      2 Accepted   KB2705219 194 KB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2705219)                   
      2 Accepted   KB2667402 159 KB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2667402)                   
      2 Accepted   KB2685939 659 KB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2685939)                   
      2 Accepted   KB2894844   4 MB Mise à jour de sécurité pour Microsoft .NET Framework 3.5.1 sous Windows 7 et Windows Server 2008 R2...
      2 Accepted   KB2977292 284 KB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2977292)                   
      2 Accepted   KB2984972  11 MB Mise à jour de sécurité pour Windows 7 pour ordinateurs à processeur x64 (KB2984972)                   
      2 Accepted   KB3039779  90 MB Mise à jour de sécurité pour Skype for Business 2015 (KB3039779) Édition 32 bits                       
      2 Accepted   KB3039782   3 MB Mise à jour de sécurité pour Microsoft Office 2013 (KB3039782) Édition 32 bits                         
      2 Accepted   KB3039798 204 KB Mise à jour de sécurité pour Microsoft Office 2013 (KB3039798) Édition 32 bits                         
                 
  • Get-WUInstall missing a Size calculation line in Stage 3
    1 Posts | Last post August 02, 2018
    • I believe there is a missing line to calculate the size of the update at the beginning of Stage 3 in the Get-WUInstall module
      
      The line on 788 needs to be copied and pasted to just before line 892.
      
      This is preventing the update size from being displayed correctly when the updates are downloading. It may also be missing from the Get-WUList module as well
  • Not working on Server 2016
    2 Posts | Last post July 20, 2018
    • This script works fine on Server 2012 but not in Server 2016. Is there an updated script that I can get hold of. Or please let me know if there is anything else out there. 
      Thank you.
    • I've been using this without issue in Windows 10 and Server 2016. Can you provide more details?
  • Version 2.0.0.4: How do you install updates remotely?
    1 Posts | Last post June 28, 2018
    • I'm using 2.0.0.4.  What is the replacement for Invoke-WuInstall?  I use it extensively for remote updating and the modules will only run locally.
  • Unable to Run Windows Update On Remote Computers
    3 Posts | Last post June 27, 2018
    • I am actually trying to install windows update on remote computers using below powershell command but it gives an error mentioned below
      Step 1: Trying to Create New Session for list of computers
      
      $s = New-PSSession -ComputerName (Get-Content "C:\WindowsUpdate-Prod\Prod\MT-Servers.txt")) -Credential mtc-maersk\sgs035adm -ThrottleLimit 50
      
      Using Invoke-WUInstall, trying to install windows update on remote computers, when run like " invoke-wuinstall -computername "RemoteComputerName" it works but it gives error if use the below method
      
      Invoke-WUInstall -ComputerName $s -Script {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -AutoReboot  | Out-File C:PSWindowsUpdate.log  } -Confirm:$false -Verbose
      
      Error: when i try to create new session from list computers ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide anargument that is not null or empty, and then try the command again.At line:1 char:34+ ... omputerName (Get-Content C:\WindowsUpdate-Prod\Prod\MT-Servers.txt) - ...+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidData: (:) [New-PSSession], ParameterBindingValidationException    + FullyQualifiedErrorId : ParameterArgumentValidationError,
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      Error: when i try to run Invoke-Command -ComputerName (Get-Content "Location\server.txt"
      PS C:\Windows\system32> Invoke-WUInstall -ComputerName (Get-Content "C:\WindowsUpdate-Prod\Prod\MT-Servers.txt") -Script {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll -AutoReboot  | Out-File C:\WindowsUpdate\PSWindowsUpdate.log  } -Confirm:$false -VerboseVERBOSE: Populating RepositorySourceLocation property for module PSWindowsUpdate.VERBOSE: Loading m
      +++++++++
    • I tried the below as well
      
      $RemoteComputers = Get-Content "C:\WindowsUpdate-Prod\Prod\MT-Servers.txt"
      
      If (Test-Connection -ComputerName $RemoteComputers -Quiet)
      {
           Invoke-Command -ComputerName $RemoteComputers -ScriptBlock {Get-ChildItem “C:\WindowsUpdate\Test.ps1”}
      }
      but no luck!! Winrm is listening and i am able to access the server if i try with just invoke-wuinstall -computername <compname>.
      please assit
    • on the line where you are creating sessions you need to change it to this
      $s = Get-Content "C:\WindowsUpdate-Prod\Prod\MT-Servers.txt"
      The -Computername is expecting a string and you are passing a session object, so it blows up.
1 - 10 of 319 Items