title: Getting command output from Invoke-Command
body: <p>I'm trying to use Invoke-Command to run a command in PowerShell remotely on a number of machines, and capture their output from it, but I'm not getting any output from it.  I suspect it's from how I'm using Start-Process, but I'm not sure.</p>
  
  <pre><code>$RunCommand = {
      Start-Process "$env:ProgramFiles\Some Program\someprogram.exe" -ArgumentList "-SignatureUpdate"
  }
  
  $comp_list = @(Get-Content "c:\temp\comp_list.txt")
  $cred = Get-Credential
  
  $jobs = Invoke-Command -Credential $cred -Computer $comp_list -ScriptBlock $RunCommand -AsJob
  
  Wait-Job $jobs
  $r = Receive-Job $jobs
  $r | % { $_ &gt; c:\temp\$($_.PScomputerName).output }
  </code></pre>
  
  <p>Is there a better way to invoke a command using environment variables like that?</p>