title: Safest way to run BAT file from Powershell script
body: <p>I can not get a powershell script to execute a bat file directly. For example, this works on the command line:</p>
  
  <pre><code>.\\my-app\my-fle.bat
  </code></pre>
  
  <p>When I add this command to a script, it outputs:</p>
  
  <pre><code>The term '.\\my-app\my-file.bat' is not recognized as the 
  name of a cmdlet, function, script file, or operable program. 
  Check the spelling of the name, or if a path was included, 
  verify that the path is correct and try again.
  </code></pre>
  
  <p>I also tried the following, with the same result:</p>
  
  <pre><code>&amp; .\\my-app\my-fle.bat
  &amp; ".\\my-app\my-fle.bat"
  \my-app\my-fle.bat
  &amp; \my-app\my-fle.bat
  &amp; "\my-app\my-fle.bat"
  </code></pre>
  
  <p>Note: It must return the lastexitcode as I need to verify success of batch.</p>