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.

 
 
 
 
 
(124)
76,186 times
Add to favorites
Windows Update
12/24/2013
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • get-wulist remotecomputer problem
    1 Posts | Last post May 23, 2014
    • Hi all,
      
      I test this module, and i dont get any information from remote server.
      Test from my PC:
      
      PS C:\> Get-WUList -ComputerName nas
      PS C:\> Get-WUList -ComputerName nas -Debuger
      DEBUG: STAGE 0: Prepare environment
      DEBUG: Check if ComputerName in set
      DEBUG: STAGE 1: Get updates list
      DEBUG: Create Microsoft.Update.Session object for nas
      DEBUG: Create Microsoft.Update.Session.Searcher object for nas
      DEBUG: Set source of updates to default (for nas) Windows Update
      DEBUG: Set pre search criteria: IsInstalled = 0
      DEBUG: Search criteria is: IsInstalled = 0
      PS C:\>
      
      Test from server:
      
      PS C:\> Get-WUList
      
      ComputerName Status KB          Size Title
      ------------ ------ --          ---- -----
      NAS          ------ KB2668562   6 MB Microsoft Silver
      NAS          D----- KB2953522  15 MB Sicherheitsupdat
      NAS          D----- KB890830    7 MB Windows-Tool zum
      NAS          D----- KB2965065 401 KB Update für Windo
      NAS          D----- KB2920189  31 KB Sicherheitsupdat
      NAS          D----- KB2926765  13 MB Sicherheitsupdat
      NAS          D----- KB2931358 322 KB Sicherheitsupdat
      NAS          D----- KB2931366 584 KB Sicherheitsupdat
      NAS          D----- KB2954879 105 KB Update für .NET
      NAS          D----- KB2950153 213 KB Update für Windo
      NAS          ------ KB2955164  97 MB Update für Windo
      NAS          D----- KB2956575  13 MB Update für Windo
      NAS          D----- KB2958262   2 MB Update für Windo
      
      What is the problem?
      I deactivate the uac at the server, but no success.
      
      What should i do?
      Thx for the great modules.
      
      regards
      Carsten
      
      
  • PS v3 requirement
    1 Posts | Last post May 14, 2014
    • Hi,
      Your module seems to require PS v3 as it uses, among other, Unblock-File. You should update your documentation as it precises PS v2 as a prereq.
      Thanks for you work.
  • Automate WU-Install Windows 7
    7 Posts | Last post April 22, 2014
    • HI
      
      I'm having an issue automating this script from a batch file. 
      
      Using the following code the script runs in Windows 8 and 8.1, however it gives an error in Windows 7:
      powershell set-executionpolicy remotesigned
      powershell import-module pswindowsupdate
      powershell get-wuinstall -acceptall -ignorereboot
      
      The error reads as follows (in 7):
      The term 'get-wuinstall' is not recognised as the name of a cmdlet, function, script file, or operable program. Check the 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 <<<<  -acceptall -ignorereboot
           +CategoryInfo     : ObjectNotFound: <get-wuinstall:String> [], comma
         ndNotFoundException
           +FullyQualifiedErrorIF  : CommandNotFoundExcception
      
      
      Any ideas?
    • Hello, I have exactly the same problem.
      When I just run powershell as admin and run these commands:
      :\> set-executionpolicy remotesigned
      :\> import-module pswindowsupdate
      :\> get-wuinstall -acceptall -ignorereboot
      it works like a charm, but when I call the three lines from a batch file, the same thing happens as with Jason.
      Running the exact same batch file in windows 8.0 and 8.1 works like a charm.
      
      Maybe there is a difference in windows 7 powershell to windows 8 powershell (even though they're both version 2.0...
      
      Would really appreciate anyone's input on this...
      
      Thanks
    • To add insult to injury,
      
      When launching powershell from an elevated command prompt (just execute powershell.exe) I get a powershell prompt (I assume also elevated) Running the commands mentioned before I get the same errors. So I assume there is an issue calling powershell.exe (perhaps something to do with permissions?).
    • I'm glad to hear I'm not the only one.
      
      I have replicated the elevated command prompt issue as well. Still stuck for a solution though.
      
      I've looked into methods to call powershell as administrator from command line but as I'm using this in audit mode the administrator account doesn't have a password and the call to run as admin requires a passworded account. So I got stuck there as well.
    • Just create powershellscript with those three commands and call that from cmd batch
    • So my RunUpdate.ps1 has the following in it:
      Set-ExecutionPolicy RemoteSigned
      Import-Module PSWindowsUpdate
      Get-WUInstall -NotTitle "Bing" -acceptall -IgnoreReboot
      
      But if I call that from update.cmd it doesn't seem to do anything and it exits shortly after starting with no output.
      
      Update.cmd looks like this:
      powershell -executionpolicy remotesigned -file C:\Temp\RunUpdate.ps1
    • Forget that! Solved.
      
      From command line:
      POWERSHELL -ExecutionPolicy RemoteSigned -File C:\Temp\RunUpdate.ps1
      
      RunUpdate.ps1:
      Import-Module -Name PSWindowsUpdate
      Get-WUInstall -AcceptAll -IgnoreReboot -NotTitle Bing
      
      Also removed "unblock file" code from PSWindowsUpdate.psm1
      Literally deleted the line: "Get-ChildItem -Path $PSScriptRoot | Unblock-File" save & exit
      Because of an error executing the Unblock-File command - something about permissions again. Also a Windows 7 only error.
  • 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:
      Add-WUServiceManager
      Hide-WUUpdate
      
      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. 
      
      Thanks 
      SSINGH
    • 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          : http://go.microsoft.com/fwlink/?LinkId=52661
      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?
      
      Thanks,
  • 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?
      
      thanks,
  • 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
      policy?
      [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. 
11 - 20 of 114 Items