title: Cannot bind parameter to argument 'command' because it is null. Powershell
body: <p>I had a function similar to below code. It receives command and the command arguments. I had to run this command in background and collect the output. But that last statement is bugging me with this error</p>
  
  <p>Error:</p>
  
  <pre><code>Cannot bind argument to parameter 'Command' because it is null.
  + CategoryInfo          : InvalidData: (:) [Invoke-Expression], ParameterBindingValidationException
  + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.InvokeExpre
  ssionCommand
  + PSComputerName        : localhost
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>$cmd = 'Get-content'
  $Arg = 'path to file'
  $sb = "$cmd $Arg -ErrorVariable e -ErrorAction Stop"
  invoke-Expression $sb #This printsoutput
  $job = Start-job -ScriptBlock {Invoke-Expression $sb}
  wait-job -id $job.Id
  $job | Receive-job #this should print output but throwing error
  </code></pre>
  
  <p>I am pretty sure last line is the one throwing the error.</p>