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.

 
 
 
 
 
(172)
129,018 times
Add to favorites
Windows Update
12/18/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Change logs output
    2 Posts | Last post March 23, 2015
    • Hi,
      I want to change log file output, instead of X column with step number, I need a date.
      I've tryed to change get-wuinstall 
      From:
      $log = New-Object PSObject -Property @{
      Title = $Update.Title
      KB = $UpdatesExtraDataCollection[$Update.Identity.UpdateID].KB
      Size = $UpdatesExtraDataCollection[$Update.Identity.UpdateID].Size
      Status = $Status
      X = 2
      }				
      To:
      $date = get-date
      $log = New-Object PSObject -Property @{
      Title = $Update.Title
      KB = $UpdatesExtraDataCollection[$Update.Identity.UpdateID].KB
      Size = $UpdatesExtraDataCollection[$Update.Identity.UpdateID].Size
      Status = $Status
      Date = $date
      }					
      
      But it does not work, still gives me X column the in the logs. 
      
    • Found what was wrong, naed to edeit PSWindowsUpdate.Format.ps1xml file also.
      Logs output looks the way I need now.
  • Microsoft Update
    4 Posts | Last post March 10, 2015
    • Has something changed with Microsoft Update? I'm only getting the "Failed" status when I try to install updates for Windows 8.1 in audit mode.
    • I haven't seen official word from MS, but I first noticed it at the end of October, 2014.
      
      You can confirm it yourself by going to the WindowsUpdate.log, where you should see this:
      
      1     Windows OOBE is still in progress. AU deferring detection
      2     WARNING: BeginDetection failed, hr:0x8024a008
      3     All AU searches complete.
      4     # WARNING: Failed to find updates with error code 8024a008
      5     AU setting next detection timeout to 2014-10-22 12:44:24
      6     OOBE is in progress, so cannot perform Accelerated Install
      
      WU silently fails and tries again, for hours. I found nothing in the Event Viewer alerting me to the situation.
      
      It appears to be the same on Server 2012 R2 and Windows 8.1 when they're in Audit mode.
    • I have no idea what changed, but this morning it works again.
    • You must have left audit mode.
      
      I just now ran Windows update on a 2012R2 vm still in audit and I got the expected "1     Windows OOBE is still in progress. AU deferring detection" in WindowsUpdate.log and no updates are downloading.
      
      Do you have a WSUS server? That might be a difference, since I don't have one.
  • Get-WUList not Filtering Hidden Updates
    5 Posts | Last post February 11, 2015
    • Hidden updates don't seem to be being filtered correctly by Get-WUList. See below output. Only the third output is correct.You can see that the update is indeed hidden but doesn't seem to be being filtered.
      
      PS C:\Users\Administrator> Get-WUList
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ---H-- KB2977218  12 MB Microsoft Silverlight (KB2977218)
      Server1          ------ KB2461484 224 MB Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.1...
      
      
      PS C:\Users\Administrator> Get-WUList -IsNotHidden
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ------ KB2668562   6 MB Microsoft Silverlight (KB2668562)
      Server1          ------ KB2461484 224 MB Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.1...
      
      
      PS C:\Users\Administrator> Get-WUList -IsHidden
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ---H-- KB2977218  12 MB Microsoft Silverlight (KB2977218)
    • They all look right to me:
      Get-WUList
      Gets all updates hidden and not hidden
      
      Get-WUList -IsNotHidden
      Gets all updates that are not marked hidden
      
      Get-WUList -IsHidden
      Gets all updates that are marked hidden
      
      in the above you have KB2977218 as hidden the results of Get-WUList -IsNotHidden are:
      Server1          ------ KB2668562   6 MB Microsoft Silverlight (KB2668562)
      Server1          ------ KB2461484 224 MB Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.1...
      
      which doesn't contain KB2977218
    • You are completely right. please disregard. I was just looking at the title and not the KB. Please disregard. Everything is working as expected.
    • Okay, now I'm having trouble hiding the (I'm assuming dependency) KB2668562. See my output below. Seems that i'm getting matches for more than one update but I can't hide it or identify the other update. Anyone have any ideas?
      
      PS E:\Source\Scripts> Get-WUList
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ---H-- KB2977218  12 MB Microsoft Silverlight (KB2977218)
      Server1          ------ KB2461484 224 MB Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.1...
      
      
      PS E:\Source\Scripts> Get-WUList -IsNotHidden
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ------ KB2668562   6 MB Microsoft Silverlight (KB2668562)
      Server1          ------ KB2461484 224 MB Definition Update for Microsoft Endpoint Protection - KB2461484 (Definition 1.1...
      
      
      PS E:\Source\Scripts> Hide-WUUpdate -KBArticleID KB2668562 -Verbose
      VERBOSE: Connecting to Microsoft Update server. Please wait...
      VERBOSE: Found [2] Updates in pre search criteria
      VERBOSE: Found [0] Updates in post search criteria
    • I was able to finally hide this update by running the command with an empty string below. I figured this out by working with the Microsoft.Update.Session object directly.
      
      PS E:\Source\Scripts> Hide-WUUpdate -KBArticleID ""
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      Server1          ---H-- KB2977218  12 MB Microsoft Silverlight (KB2977218)
  • Exclude updates
    2 Posts | Last post February 09, 2015
    • Hi Michal, 
      
      Would it be possible to exclude specific updates?
      
      Thanks!
    • yes you would use the command line attribute NotKBArticleID
  • Limit on Get-WUIInstall -KBArticleID $kb_list -AcceptAll
    1 Posts | Last post February 09, 2015
    • PS C:\> $KBList = "KB890830", "KB2533552", "KB2539636" 
      PS C:\> Get-WUInstall -Type "Software" -KBArticleID $KBList -AcceptAll 
      
      I'm getting weird results when running the update with 78 knowledge base articles
  • Need Repeatability
    1 Posts | Last post January 28, 2015
    • If we need to ensure the same patches get on a server for production release as were tested we can't install every patch as something untested may have been released in the meantime.
      
      Supporting a simple datetime parameter for "-ReleasedBefore" would be a huge timesaver.
      
      Workarounds of saving exactly what was installed in testing to do in prod would be a pain in the neck.
  • get-wuinstall -category issue
    1 Posts | Last post January 14, 2015
    • I would like to only install security,critical updates, but when I run the below command, there are other categorizes of updates being installed, so it does not seem to be filtering. The odd thing is when I run "get-wulist -Category ("critical updates", "security updates") it returns only security and critical updates so that works fine. Am I doing something wrong?
      
      Invoke-WUInstall -ComputerName ("computer") -Script {ipmo PSWindowsUpdate; Get-WUInstall -Category ("critical updates", "security updates") -AcceptAll -AutoReboot -WindowsUpdate | Out-File C:\PSWindowsUpdate.log  } -Confirm:$false -Verbose
  • List of Categories?
    5 Posts | Last post January 05, 2015
    • Where can I find a list of all the acceptable values for "Category" and "NotCategory"?
      
      I see a partial list in Get-WUList.ps1 and the examples, but I'd like to see a full list of all categories. 
      
      Thanks. 
    • Hi,
      You can get category names for the available updates for example using:
      Get-WUList | Select KB, @{e={($_.Categories | Select -exp Name) -join ", "};l="Categories"}
      
      I know it's not very pretty, but quickly it should help.
    • Thank you for the quick response. What I'm looking for, though, is a list of all the possible values that "category" could be. Right now, when I run the command that you provided, all I see are Language Packs. However, next month there will be others. Where can I find a complete list of categories for MS Updates?
      
      Thanks. 
    • I don't know. I searched the MSDN library but never see the full list of categories.
    • This one:
      http://msdn.microsoft.com/en-us/library/ff357803%28v=vs.85%29.aspx
      
      and this one:
      http://support.microsoft.com/kb/824684
  • Get-WURebootStatus -Silent does not handle multiple -ComputerName(s)
    1 Posts | Last post December 19, 2014
    • Hello,
      
      I propose a change to this function where -Silent is used with multiple computers.
      
      Switch($RebootRequired)
      {
         $true
         {
            If($Silent)
            {
               Return $true
            }
      ...
      becomes
      ...
         If($Silent)
         {
            Write-Output "Reboot required for $($Computer)"
         }
      ...
      
      Same goes for the $false side of that Switch.
      
      Cheers,
      Kerry
      
      BTW, thanks for all of the work you've done with this.
      
  • Requirements for Remoting
    3 Posts | Last post December 15, 2014
    • What does the remote computer need for Get-WUList to work?  Many but not all of my machines return this: 
      Exception calling "CreateInstance" with "1" argument(s): "Retrieving the COM class factory for remote component with CLSID {4CB43D7F-7EEE-4906-8698-60DA1C38F2FE} from machine SERVER1 failed due to the following error: 800706ba SERVER1."
      I'm using PowerShell 5 on Windows 8.1.  I have tried running as administrator or not.  I have tried many versions of Windows on the remote computers. 
    • You haven't included the line you're executing. Get-WUList doesn't have a -computername parameter, so what makes you think it will work against a remote computer? Are you wrapping this in Invoke-Command?
    • No, I am using Get-WUList -computerName Server1.  I see now that computers with the Windows Firewall off will work.  I don't want to turn off the firewall just to use this module.  So what are the port/firewall requirements for running the Get-WUList and others in this module?
11 - 20 of 143 Items