title: How can I execute an external program with parameters in PowerShell?
body: <p>I have read this answer <a href="https://stackoverflow.com/questions/1673967/how-to-run-exe-in-powershell-with-parameters-with-spaces-and-quotes">stackoverflow</a> answer and it get's me there half way. Here is what I need to do.</p>
  
  <p>Execute this command:</p>
  
  <pre><code>"c:\myexe.exe &lt;c:\Users\Me\myanswerfile.txt"
  </code></pre>
  
  <p>If I run that straight from within my powershell script</p>
  
  <pre><code>&amp;'c:\myexe.exe &lt;c:\Users\Me\myanswerfile.txt'
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>The term 'C:\myexe.exe &lt;c:\Users\Me\myanswerfile.txt' 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, verif that the path is correct and try again.
  </code></pre>
  
  <p>Now I have tried several variations of this including placing the original command in a variable called $cmd and then passing the 
  
  <p>If I append the '&lt;' to the $cmd variable the command fails with a similar error as the first one.</p>
  
  <p>I'm stumped. Any suggestions?</p>