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
(358)
734,100 times
Add to favorites
Windows Update
4/4/2017
E-mail Twitter del.icio.us Digg Facebook
  • 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
  • windows 7 compatibility ?
    2 Posts | Last post August 02, 2017
    • My understanding after reading the documentation is that this module supports windows 7 powershell v2
      
      however it seems like v2 of powershell is missing some core needed modules
      
      unblock-file
      Add-WUServiceManager
      
      
    • ...you need to upgrade windows 7 to powershell v4
  • 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\1.5.2.6\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\1.5.2.6\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.
91 - 100 of 357 Items