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.

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

  • New (tiny) Features
    1 Posts | Last post April 17, 2014
    • Hi
      Can you add some extra switches to some of the scripts. In particular I would like to be able to automatically "AcceptAll" in the following modules:
      Currently they don't respond to the "AcceptAll" command and although I can see the script in Get-WUInstall I'm not knowledgeable enough implement this code into the other modules myself.
  • Reliability of WindowsUpdate
    2 Posts | Last post April 16, 2014
    • First of all your module is wonderful 
      I also want in my reporting whether installed windows update is successful or not.
      I read something about reliablity in wmi but could you merge the same in this module. 
    • I think what you're asking is answered just down the page. See the post from Rosco_CA.
  • Date patch was released
    1 Posts | Last post April 15, 2014
    • Your module is a great help.
      I may have missed it but is there a way to get the date a patch was released?
  • Windows Update History
    1 Posts | Last post April 15, 2014
    • Recently i am getting out put in history file like 
      KB                  : KB2267602
      ComputerName        : DDDDDDDDDDDD
      Operation           : 1
      ResultCode          : 2
      HResult             : 0
      Date                : 4/15/2014 5:36:23 AM
      UpdateIdentity      : System.__ComObject
      Title               : Definition Update for Windows Defender - KB2267602 (Definition 1.169.2635.0)
      Description         : Install this update to revise the definition files that are used to detect viruses, spyware, and 
                            other potentially unwanted software. Once you have installed this item, it cannot be removed.
      UnmappedResultCode  : 0
      ClientApplicationID : 
      ServerSelection     : 2
      ServiceID           : 
      UninstallationSteps : System.__ComObject
      UninstallationNotes : 
      SupportUrl          :
      Categories          : System.__ComObject
      Earlier this was coming in a single line.
      DDDDDDD 09-04-2014 10:49:12 KB915597  Definition Update for Windows Def...
      Please guide me why these changes are coming.
      Many thanks in advanced
  • Reboot after installation
    1 Posts | Last post April 08, 2014
    • Hi,
      Recently I have found that there are 3 updates that do not automatically install using the script. They require a "Update and Restart" for them to be installed.
      Is there anyway to resolve this?
  • Update-WUModule
    1 Posts | Last post April 07, 2014
    • Hi,
      Having trouble using the Update-WUModule. Any chance i could get an example of the usage of this please?
  • I'm unable to get this to run
    2 Posts | Last post April 02, 2014
    • Windows Server 2008 R2 
      PS C:\Windows\system32> Set-ExecutionPolicy unrestricted
      Execution Policy Change
      The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
      you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution
      [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
      PS C:\Windows\system32> Import-Module pswindowsupdate
      Import-Module : There were errors in loading the format data file:
      Microsoft.PowerShell, C:\Users\sdailey\Documents\WindowsPowerShell\Modules\pswindowsupdate\PSWindowsUpdate.Format.ps1xm
      l : File skipped because it was already present from "Microsoft.PowerShell".
      At line:1 char:14
      + Import-Module <<<<  pswindowsupdate
          + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
          + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
      PS C:\Windows\system32> get-WUinstall
      The term 'get-WUinstall' is not recognized as the name of a cmdlet, function, script file, or operable program. Check t
      he spelling of the name, or if a path was included, verify that the path is correct and try again.
      At line:1 char:14
      + get-WUinstall <<<<
          + CategoryInfo          : ObjectNotFound: (get-WUinstall:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      Main error is File skipped because it was already present from "Microsoft.PowerShell"
    • Also as a note I was able to run this on a windows 7 box without issue. 
  • Can't seem to nail the criteria
    1 Posts | Last post April 02, 2014
    • I'm trying to install all critical and security updates, but for reasons I don't understand, this includes new versions of .net and IE.  I don't want new versions of ANYTHING to be included.  I know they have to be indicated a different way, but I can't figure out how to indicate it.  Even when I use -IgnoreUserInput and -AutoSelectOnly, I still wind up with IE 11 wanting to install on my servers.  Any help would be greatly appreciated.
  • Notification on failure
    3 Posts | Last post April 02, 2014
    • Firstly this Module is amazing. I'm using it to automate the snapshotting of VM's by folder and updating the successful snapshots with this module. The only thing I'm wondering is if an update tries to apply via Get-WUInstall and fails is there a special output that will be visible in the WUInstall output or even better from the Get-WUHistory Cmdlet? Considering the machine sometimes applies operations post reboot I believe the only reliable way to do this would be with Get-WUHistory if at all. 
      I would like to say in my script that if any updates have a hard failure then revert to snapshot and notify with reliability.
      Thank you very much for your contribution!
    • I found my own answer. I looked into your code and by altering the Format file to include a "Status" column for the PSWindowsUpdate.WUHistory Object and by Altering the Get-WUHistory.ps1 script to add a member to $obj based on the "ResultCode" of the CreateUpdateSearcher() object, I was able to pull the additional data. Thanks for the well commented code!
    • Hopefully Michal will include this addition in the next update.
  • Licensing PSWindowsUpdate
    1 Posts | Last post February 28, 2014
    • Hi Michal,
      We love this library and are considering make use of it in some software of our own.  Have you considered releasing it under a well known Open Source license like GPL?
      Best wishes,
11 - 20 of 111 Items