title: Executing powershell in a working directory containing angle brackets
body: <p>Say I have two files in a directory with angle brackets in the path (e.g. <code>c:\foo[bar]</code>)</p>
  
  <ul>
  <li><code>test.ps1</code></li>
  <li><code>test.bat</code></li>
  </ul>
  
  <p>In <code>test.ps1</code> all I have is:</p>
  
  <pre><code>"HelloWorld"
  </code></pre>
  
  <p>In <code>test.bat</code> I have:</p>
  
  <pre><code>powershell -file test.ps1
  echo %errorlevel%
  </code></pre>
  
  <p>Where powershell v2 is installed, if I execute <code>test.bat</code> from the command prompt, with the working directory in the <code>foo[bar]</code>, I get "HelloWorld" output from the ps script but the error code <strong>1</strong> echoed to the console. This does not occur when the path contains no angle brackets or in instances where powershell v3 is installed ("HelloWorld" is output and <strong>0</strong> is returned as the error code).</p>
  
  <p>This just appears to be a problem when using the powershell v2 executable with the <code>-file</code> switch. My first assumption is that this is a bug, but I couldn't find anything out there on this specific problem.</p>
  
  <p>Is there any workaround or solution to this?</p>