title: Using read-host cmdlet when execute powershell script file in MSBuild
body: <p>All , I am trying to execute a external power shell script file in the MSBuild. But every time when PS run the cmdlet <code>Read-Host</code>. The MSBuild seems stop. and doesn't prompt me to input . I don't know what happen to it . Seems the console is in deadlock..thanks.</p>
  
  <p><img src="https://i.stack.imgur.com/LdhBF.png" alt="enter image description here"> </p>
  
  <p>The testloop.ps1 code is shown below.</p>
  
  <pre><code>$ErrorActionPreference = 'Stop'
  $error.clear()
  
  
  function GetAzureSubScription()
  {
      read-host "please input something :"
  } 
  
  write-host "Get into script"
  
  GetAzureSubScription
  </code></pre>
  
  <p>The MSBuild code is below (wrapped for clarity):</p>
  
  <pre><code>&lt;Exec WorkingDirectory="$(MSBuildProjectDirectory)" 
      Command="$(windir)\system32\WindowsPowerShell\v1.0\powershell.exe -f
      E:\Work\AutoDeploy\testloop.ps1" /&gt;
  </code></pre>