title: Powershell script for bulk updating Windows Updates on many pc's
body: <p>I have this script: </p>
  
  <pre><code>Invoke-WUJob -ComputerName comp-1,comp-2,comp-3 -Script {ipmo PSWindowsUpdate; Get-WUInstall -Install -AcceptAll | Out-File C:\PSWindowsUpdate.log  } -Confirm:$false -Verbose –RunNow
  </code></pre>
  
  <p>and after execution I get this: </p>
  
  <blockquote>
    <p>Invoke-WUJob : PSWindowsUpdate module missing on destination machine
    At line:1 char:1
    + Invoke-WUJob -ComputerName 1002-hk-ws-001,1002-hk-ws-002,1002-hk-ws-0 ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceUnavailable: (:) [Invoke-WUJob], Exception
        + FullyQualifiedErrorId : ModuleMissing,PSWindowsUpdate.InvokeWUJob</p>
  </blockquote>
  
  <p>I used these commands below on every PC to install to PSWindowsUpdate and setup winrm and it still does not work:</p>
  
  <pre><code>winrm quickconfig -q 
  
  winrm set winrm/config/client ‘@{TrustedHosts="comp1,comp2,comp3"}’
  
  Set-ExecutionPolicy RemoteSigned
  
  Install-Module PSWindowsUpdate -Scope CurrentUser -Force
  </code></pre>
  
  <p>Any ideas?</p>