title: Running PowerShell from MSdeploy runcommand does not exit
body: <p>Im am trying to get MSDeploy to execute a PowerShell script on a remote server. This is how i execute MSDeploy:</p>
  
  <pre><code>msdeploy \
    -verb:sync \ 
    -source:runCommand='C:\temp\HelloWorld.bat', \
    waitInterval=15000,waitAttempts=1 \
    -dest:auto,computername=$WebDeployService$Credentials -verbose
  </code></pre>
  
  <p>HelloWorld.bat contains:</p>
  
  <pre><code>echo "Hello world!"
  powershell.exe C:\temp\WebDeploy\Package\HelloWorld.ps1
  echo "Done"
  </code></pre>
  
  <p>The HelloWorld.ps1 only contains:</p>
  
  <pre><code>Write-Host "Hello world from PowerShell!"
  </code></pre>
  
  <p>However, it seems like PowerShell never terminates. This is the output from running the msdeploy:</p>
  
  <pre><code>Verbose: Performing synchronization pass #1.
  Verbose: Source runCommand (C:\temp\HelloWorld.bat) does not match destination (C:\temp\HelloWorld.bat) differing in attributes (isSource['True','False']). Update pending.
  Info: Updating runCommand (C:\temp\HelloWorld.bat).
  Info:
  
  Info: C:\temp&gt;echo "Hello world!"
  "Hello world!"
  
  C:\temp\WebDeploy&gt;powershell.exe C:\temp\HelloWorld.ps1
  
  Info: Hello world from Powershell!
  Info:
  
  Warning: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat
  "') is still running. Waiting for 15000 ms (attempt 1 of 1).
  Error: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Users\peter\AppData\Local\Temp\gaskgh55.b2q.bat"'
  ) was terminated because it exceeded the wait time.
  Error count: 1.
  </code></pre>
  
  <p>Anyone knows a solution?</p>