title: PowerShell script called from within the Jenkins PowerShell build step hangs indefinitely
body: <p>I have a Jenkins (1.493) project that uses the Jenkins PowerShell build step to execute a PowerShell script. Inside that script I want to invoke another script that is stored inside a file. I have now reduced it to the following:</p>
  
  <p>Script inside Jenkins PowerShell build step:<br>
  <code>&amp; "\\stemmer.local\sidevelopment\cvdev\devbase\jenkins\PowerShell\Test.ps1"</code></p>
  
  <p>Content of Test.ps1:<br>
  <code>write-host 'Hello world!'</code></p>
  
  <p>Whenever this Jenkins project executes, the PowerShell build step hangs indefinitely.</p>
  
  <p>Things I have tried/verified so far:</p>
  
  <ul>
  <li>Adding some output before the invocation of <code>Test.ps1</code> shows me that the Jenkins PowerShell script is being execute normally up to the point where <code>Test.ps1</code> is called.</li>
  <li>The file <code>Test.ps1</code> exists and is reachable from the build slave that executes the script. If I alter the file's name, I get the expected error message from PowerShell...</li>
  <li>Exchanging the " for ' in the 1st script does not change anything. Also, using dot-sourcing rather than <code>&amp;</code> does not help.</li>
  <li>The file <code>Test.ps1</code> can be executed properly from the powershell itself using the same command line that is being used in the Jenkins PowerShell script.</li>
  <li>The execution policy for PowerShell has been set to <code>unrestricted</code> on my development host as well as on the Jenkins build slave.</li>
  <li>I've tried replacing the PowerShell build step with a Windows batch command build step that looks like this:<br><code>powershell.exe -InputFormat None -File "\\stemmer.local\sidevelopment\cvdev\devbase\jenkins\PowerShell\Test.ps1"</code><br>and played around a little with the parameters of powershell.exe, but the results were - in those cases that were syntactically and otherwise correct as far as I can tell - always the same.</li>
  </ul>
  
  <p>I only found few references to problems that sounded similar, but none of the approaches mentioned elsewhere did help me fix this. I am absolutely puzzled, and wondering whether someone encountered this issue before (and maybe even got a scenario like the one I have in mind running).</p>
  
  <p>Thanks a lot for any input!</p>
  
  <pre><code>Volker
  </code></pre>