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.

218,670 times
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Trying to automate Windows update.
    1 Posts | Last post October 27, 2015
    • I'm Trying to create a scenario that turns on a computer at 3am. Then i have the computer runs a scheduled task that runs the PSWindowsUpdate on the local computer. This then downloads all available updates from wsus server, installs them and restarts the computer if necessary. My questions is can this be don, no user is logon on to the local computer. What i'm doing now is via pdq deploy i wake on lan the computer a 2.50 am then i have create a scheduled task via gpo that runs a ps script. Executionpolicy is set to remotesigned. Import-Module \\fkipdc01\NETLOGON\PSWindowsUpdate\PSWindowsUpdate\PSWindowsUpdate.psm1; Get-WUinstall -IgnoreUserInput -acceptALL -AutoReboot. The scheduled task Works fine but the problem is that the computer dos not install and restart There is many updates available, the test computer is from a image where there is 40 updates available. After 1 hour i log on to the computer i can se that the computer has downloaded the updates and is prompting my for restart, to installe updates. How can i get it to work so i can get ps update to run even if no user is log on. Scheduled task is set to run even if no user is log on. If i can get this to work i will be deployed to 150 computers.
  • Ipmo ?
    2 Posts | Last post October 04, 2015
    • I have to import this module every time I want to use it after a reboot. Any way to make it stick permanently?
    • I extracted to system folder and all is well now. Not sure why the ipmo command was not sticking after reboot though
  • Get data from "System.__ComObject"
    2 Posts | Last post October 01, 2015
    • Hello,
      I am using the PSWindowsUpdate custom module to collect Windows Update information on servers.  The function "Get-WUList" returns a lot of data including some of type "System.__ComObject".  One of these, "Categories", seems to be an array, but I cant seem to pull data from it in a way I think I should be able to.  Here is an example:
      Name        : Security Updates
       CategoryID  : 0fa1201d-4330-4fa8-8ae9-b877473b6441
       Children    : System.__ComObject
       Description : A broadly released fix for a product-specific security-related vulnerability. Security vulnerabilities
                     are rated based on their severity which is indicated in the Microsoft® security bulletin as critical,
                     important, moderate, or low.
       Image       :
       Order       : -1
       Parent      :
       Type        : UpdateClassification
       Updates     : System.__ComObject
      Name        : Visual Studio 2010
       CategoryID  : c9834186-a976-472b-8384-6bb8f2aa43d9
       Children    : System.__ComObject
       Description : Visual Studio 2010
       Image       :
       Order       : -1
       Parent      : System.__ComObject
       Type        : Product
       Updates     : System.__ComObject
      What I want to get is the "Visual Studio 2010" part (the "Name" property from the second item in the "array" - at least what I think is an array).  To me, this looks like $Updates[0].Categories[1].Name should get me the data.  But it returns nothing.  So I am confused how I navigate around this data structure, which looks like an array, but I am guessing is not.
      Any suggestions how to get this data?
    • I think I figured out how to do it - I had to peek at Michal's Get-WUList.ps1 file for a hint.  You have to use " | Select Name" to get the data:
      $Categories = $Updates[0].Categories | Select Name
      Then $Categories[1] will yield the "Visual Studio 2010" name I was looking for.
  • Running from vFabric AppDir
    1 Posts | Last post September 18, 2015
    • Michal - thanks in advance! this is amazing!
      In running this to Win7 and W2K8 R2, it informs me that I need to run in an elevated session.  suggestion for doing this?  The default account this runs under is in the Local Administrators account...
  • Format-table
    2 Posts | Last post September 18, 2015
    • Hello,
      When outputting the logs to a file, the WSUS updates are always truncated. Tried using format-table -autosize, but it doesn't seem to help. 
      Get-WUInstall -Verbose -AcceptAll -IgnoreReboot | Format-table -autosize | Out-File $LogLocal -Append
      SO the logs look like this:
      X Status     KB          Size Title                                            
      - ------     --          ---- -----                                            
      2 Accepted   KB3089023  18 MB Update for Internet Explorer Flash Player for ...
      2 Accepted   KB3087038  53 MB Cumulative Security Update for Internet Explor...
      2 Accepted   KB3082089   3 MB Security Update for Windows Server 2012 R2 (KB...
      2 Accepted   KB3069114   5 MB Security Update for Windows Server 2012 R2 (KB...
      2 Accepted   KB3084135 803 KB Security Update for Windows Server 2012 R2 (KB...
      2 Accepted   KB3087088 395 KB Security Update for Windows Server 2012 R2 (KB...
      Anyone know how to get the full title?
    • Hi willemdha - try adding:    Format-Table -Wrap -AutoSize  at the end of your statement.  See if that helps.
  • How exclude KB3012973 (update to windows 10)?
    1 Posts | Last post September 15, 2015
    • I have *.cmd with command:
      PowerShell -ExecutionPolicy RemoteSigned -Command Import-Module PSWindowsUpdate; Get-WUInstall -AcceptAll -IgnoreReboot
      which command exclude download and installing KB3012973 in script?
  • Recommended Updates?
    1 Posts | Last post September 05, 2015
    • Is there any way to install recommended updates in addition to security updates and critical updates?
      We would like to achieve the same results as running "wuapp.exe", clicking "Check for updates", and clicking "Install updates" when the Windows Updates settings are set to "Install updates automatically (recommended)" and "Give me recommended updates the same way I receive important updates" is checked.
  • Exclude multiple titles
    4 Posts | Last post August 31, 2015
    • I would like to be able to exclude multiple titles and doing this $exclude = "title1", "title2", "title3"
      Get-WUInstall -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -NotTitle $Exclude
      does not work. I get
      Get-WUInstall : Cannot process argument transformation on parameter 'NotTitle'. Cannot convert value to type
      Can someone guide me please. I appreciate it.
    • In your example $exclude - Array of strings
      You need to write only 1 string 
      Try to use
      $exclude = "title1"
      Get-WUInstall -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -NotTitle $Exclude
    • I understand that using only one title will work, and I appreciate your response, but my question was, "How do I exclude multiple titles?". Sincerely, thank you anyway for taking the time to respond.
    • You can try to use "where" for exclude multiple titles
      Something like this
      Get-WUInstall -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -NotTitle | Where {$Exclude -notcontains $_.title}
  • Exclude multiple updates from WUList
    1 Posts | Last post August 26, 2015
    • I have noticed with running get-WUList it will never pull more than 70 updates. I already have a script using PSWindowsUpdate module that hides and unhides Windows updates based on whether or not they exist in a list that is provided by my vendors. Depending on the list a lot of updates my end up hidden, quickly increasing the number of hidden updates. In order to be thorough I must also check against the hidden ones every time I run the script to make sure none of them are now approved.
      What options do I have to broaden how many updates it can pull or even exclude the 70 that come in through the first pass with Pre-Search Criteria? Would really appreciate feedback on this issue.
  • Is there a way to exclude all driver updates?
    1 Posts | Last post August 25, 2015
    • I have tried something like this (adding multiple lines for different drivers"
      $UpdatesList = Get-WUList -ServiceID "9482f4b4-e343-43b6-b170-9a65bc822c77" -Title "nVidia"
      $UpdatesList.IsHidden = $true
      I also tried this, but I get an error. I forget the error, but can recreate it if requested. It is something regarding not being able to give the hide atribute to some of the updates in the list.
      $UpdatesList = Get-WUlist -ServiceID 9482f4b4-e343-43b6-b170-9a65bc822c77 -UpdateType Driver
      $UpdatesList.IsHidden = $true
      I appreciate your time.
11 - 20 of 190 Items