title: Powershell script completes but exits with error code 1
body: <pre><code>$myValue= (.\command.exe arguments | select -first 1)
  </code></pre>
  
  <p>I run the above code in my Azure Devops pipeline,
  <code>$myValue</code> contains the value I'm expecting, but I get:</p>
  
  <pre><code>##[error]PowerShell exited with code '1'.
  </code></pre>
  
  <p>returned once my task completes... Does anyone have any idea why? I don't know if this is a syntax problem, or if my <code>command.exe</code> does something strange to affect the exit code.</p>