title: Powershell process 'hanging' when running remote batch file
body: <p>I'm trying to run a batch file on a remote server via a drive mapping as follows, but the process hangs...</p>
  
  <pre><code>Enable-WSManCredSSP -Role Client -DelegateComputer someserver -Force
  
  $credential = Get-Credential -Credential domain\user (then I supply the password in the popup)
  
  $RemoteSession = New-PSSession -ComputerName someserver -Credential $credential -Authentication Credssp
  
  Invoke-Command -Session $RemoteSession -ScriptBlock { Enable-WSManCredSSP -Role Server -Force }
  
  Invoke-Command -Session $RemoteSession -ScriptBlock { New-PSDrive -Name I -PSProvider FileSystem -Root \\server\share$ }
  </code></pre>
  
  <p>Everything seems fine up to this point and I can 'dir' the I drive and see the expected content.</p>
  
  <p>When I execute the following, the process hangs - </p>
  
  <pre><code>Invoke-Command -Session $RemoteSession -ScriptBlock { Start-Process I:\temp.bat }
  </code></pre>
  
  <p>The temp.bat file executes the following command and I've verified manually that it works </p>
  
  <pre><code>echo Scott was here &gt; C:\temp.txt
  </code></pre>
  
  <p>However, the command runs for over 5 minutes without any response.</p>
  
  <p>Can anyone help? What have I done wrong?</p>