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


  • Source code
    1 Posts | Last post September 01, 2017
    • I'd like to be able to contribute to some of the cmdlets. Please could you publish the code to github or similar? I noticed there is already a fork there, https://github.com/joeypiccola/PSWindowsUpdate, with some enhancements, and there's a chocolatey package which allows specific (but old) versions of the module to be depended on (https://chocolatey.org/packages/pswindowsupdate).
      
      It would be wonderful to get the canonical source code published.
  • Add-WUOfflineSync : Value does not fall within the expected range.
    1 Posts | Last post August 28, 2017
    • Trying to add an offline sync catalog so that I can scan for needed updates on a machine that cannot connect with the internet.  Getting the following error.  Machine is Windows 10.  Can you help?
      
      Add-WUOfflineSync : Value does not fall within the expected range.
      At line:1 char:1
      + Add-WUOfflineSync -Path D:\WUOfflineSync\wsusscn2.cab
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-WUOfflineSync
  • Not Hiding Specified Updates
    1 Posts | Last post August 18, 2017
    • I am trying to hide all updates with the words Skype, Visio, OneNote, and OneDrive in the title. I have tried:
      
      Hide-WUUpdate -Title "Skype" -Confirm:$false
      Etc.
      Etc.
      Etc.
      
      However, when I then run Get-WUList -MicrosoftUpdate, it is still showing updates from all of the above. (Although it does appear to hide some of the updates, but not all of them.) 
      
      I have also tried specifying the KBArticlID, but this doesn't work either.
      
      Any ideas?
  • Only display Title, KB, and Status with Get-WUList
    3 Posts | Last post August 17, 2017
    • Can anyone advise me on how to only display the Title, KB and Status of available updates when running Get-WUList? Currently, on my W10 machine it outputs a ton of unnecessary information. I just like a basic list. Thanks.
    • Get-WUList | Select Title, KB, Status
    • Thanks.That was easy enough haha. I thought I had previously tried Get-WUList | Select Title earlier and it through an error, but I must have been imagining that because your suggestion works perfectly. 
  • Just a suggestion
    1 Posts | Last post August 12, 2017
    • When the connection to Windows Update Server (or Windows Server Update Server or MIcrosoft Update Server) is for some reason not possible (no network connection of computer running PSWindowsupdate, WSUS down etc.) no error message is displayed, even if Get-WUInstall ist started with -verbose.
      It just says "Connecting to Windows Server Update Service Server" (or Microsoft Update or Windows Update) for a couple of seconds and the exits.
      It might be nice if there was some kind of message like "Update server could not be reached".
      Just a suggestion for future versions.
      Thanks by the way for this wonderful tool which is a life-saver for admins! 
  • Strat update with user rights only
    3 Posts | Last post August 08, 2017
    • Hi, I try to start installing updates on local machine from user account and get an error:
      
      get-wuinstall -acceptall -verbose -ignorereboot
      
      WARNING: To perform some operations you must run an elevated Windows PowerShell console.
      VERBOSE: Connecting to Windows Server Update Service server. Please wait...
      VERBOSE: Found [1] Updates in pre search criteria
      VERBOSE: Found [1] Updates in post search criteria
      VERBOSE: Accept [1] Updates to Download
      WARNING: Your security policy don't allow a non-administator identity to perform this task
      
      Is any way to start updates if I have only user rights?
      Start-Process powershell -Verb runAs - didn't work because it asking for credentials
      
    • Try removing -ignoreboot
    • The same error
      
      get-wuinstall -acceptall -verbose
      WARNING: To perform some operations you must run an elevated Windows PowerShell console.
      VERBOSE: Connecting to Windows Server Update Service server. Please wait...
      VERBOSE: Found [1] Updates in pre search criteria
      VERBOSE: Found [1] Updates in post search criteria
      VERBOSE: Accept [1] Updates to Download
      WARNING: Your security policy don't allow a non-administator identity to perform this task
  • PSWindowsUpdate doesn't install downloaded packages
    1 Posts | Last post August 04, 2017
    • My HP EliteBook Folio took a long time to download a 1GB package, then it didn't install any of the packages it downloaded.  The laptop is connected to a Corporate network, so there is no issue with network.  Please help, thanks.
      Here is my batch script.  I ran it as admin.
      
      xcopy %Network%\PowerShellModules\PSWindowsUpdate\* c:\Windows\System32\WindowsPowerShell\V1.0\Modules\PSWindowsUpdate\ /y
      powershell.exe "Set-Executionpolicy Unrestricted -Scope Currentuser"
      powershell.exe "Import-Module PSWindowsUpdate"
      timeout /t 10
      powershell.exe "Get-WUInstall -Verbose -Acceptall -IgnoreReboot -IgnoreUserInput"
  • Please help!!
    6 Posts | Last post August 04, 2017
    • Hi, I am trying to automate the report to get a list of new patches since last patching. 
      I want to fetch the list from WSUS with OS and number of new patches and have this list emailed. I am not sure where to start from. I cannot get the list of update for the whole wsus.
      
      I am new to powershell so not sure where to start from. Please assist. 
      Thanks
    • I also encountered this, it's in two files (http://i.imgur.com/XEaZg6z.png).
      
      Under the description tab is a list of attachments, I'm trying 1.4.5 and it does NOT use unblock.
    • I have the same problem but in my case I think after the message "Starting installation of downloaded updates" nothing seems to download.. please help me out.. How does your script tun after this?
      
    • @ Dailen, go to the location where you unzipped the files, right click > properties each file individually and click the unblock 
    • You can use the following script to email a report generated by PSWindowsUpdate module:
      
      $eAddress='email@yourdomain.us'
      
      Get-WUList -ComputerName $env:COMPUTERNAME | Select-Object KB, Size, Title | ConvertTo-Html | Format-Table -AutoSize -Wrap | Out-File "C:\$env:COMPUTERNAME-WSUS.html"
      
      Microsoft.PowerShell.Utility\Send-MailMessage -To $eAddress -Subject "WSUS updates for $env:COMPUTERNAME" -Attachments C:\$env:COMPUTERNAME-WSUS.html -SmtpServer mail.yoursmptserver.us -From "$env:COMPUTERNAME@yourdomain.us"
      
      #Script End use lines above this
      --------------------
      Note: $env:COMPUTERNAME was used a lot but should be substituted with remote computer name and local computer name where needed
      
    • My HP EliteBook Folio took a long time to download a 1GB package, then it didn't install any of the packages it downloaded.  The laptop is connected to a Corporate network, so there is no issue with network.  Please help, thanks.
  • List of new patches since last updates
    2 Posts | Last post August 03, 2017
    • Hi, I am trying to automate the report to get a list of new patches since last patching. 
      I want to fetch the list from WSUS with OS and number of new patches and have this list emailed. I am not sure where to start from. I cannot get the list of update for the whole wsus.
      
      I am new to powershell so not sure where to start from. Please assist. 
      Thanks
    • You can use the following script to email a report generated by PSWindowsUpdate module:
      
      $eAddress='email@yourdomain.us'
      
      Get-WUList -ComputerName $env:COMPUTERNAME | Select-Object KB, Size, Title | ConvertTo-Html | Format-Table -AutoSize -Wrap | Out-File "C:\$env:COMPUTERNAME-WSUS.html"
      
      Microsoft.PowerShell.Utility\Send-MailMessage -To $eAddress -Subject "WSUS updates for $env:COMPUTERNAME" -Attachments C:\$env:COMPUTERNAME-WSUS.html -SmtpServer mail.yoursmptserver.us -From "$env:COMPUTERNAME@yourdomain.us"
      
      #Script End use lines above this
      --------------------
      Note: $env:COMPUTERNAME was used a lot but should be substituted with remote computer name and local computer name where needed. Other items that you will need to fill in are your email, SMTP server, From email address.
  • Only install 1st object
    1 Posts | Last post August 02, 2017
    • Trying to only install first update for the purposes of installing an update at a time.
      
      
      Script:
      $list = (get-wulist -nottitle "internet Explorer" -microsoftupdate | select-object -first 1)
      $list = $list.title
      Get-wuinstall -title $list -microsoftUpdate -ignorereboot -AcceptAll -verbose
      
      Return:
      Found [24] updates in pre search criteria
      Found [0] updates in post search criteria
      
      
      
      Any assistance would be appreciated.   Thanks in advance
11 - 20 of 283 Items