title: Jenkins Pipeline, PowerShell script hangs
body: <p>I want to run a Powershell file from the Jenkins Pipeline, using the powershell command. Should be easy, right?</p>
  
  <pre><code>node()
  {
      stage ('Hello World') {
          powershell returnStatus: true, script: 'C:\\HelloWorld.ps1'
      }   
  }
  </code></pre>
  
  <p>C:\HelloWorld.ps1 is a one-liner:</p>
  
  <pre><code>Write-Host "Hello World"
  </code></pre>
  
  <p>But running the job causes the process to hang. Here is the console output:</p>
  
  <pre><code>Started by user Administrator
  [Pipeline] node
  Running on master in C:\Jenkins\workspace\HelloWorld
  [Pipeline] {
  [Pipeline] stage
  [Pipeline] { (Hello World)
  [Pipeline] powershell
  [HelloWorld] Running PowerShell script
  </code></pre>
  
  <p>And then it just hangs until I cancel the job.</p>
  
  <p>What to do?</p>