title: Escape special chars in powershell commands
body: <p>I am new to powershell, but I am facing a very basic problem. When I am running the following command powershell complains. It seems to have issues with the special chars: <code>[*, =, &amp;, &lt;, &gt;]</code>. Any ideas how do I escape them ? This is powershell version 2. [I am using winexe to run the powershell command from a linux box. If I copy paste the ps command it seems to work fine, but remotely running it cause powershell to complain.]</p>
  <pre><code>winexe &quot;cmd /c echo . | powershell Set-ExecutionPolicy bypass -Force -Scope CurrentUser;C:\test.ps1  -name 'B*=&amp;&lt;+&gt;%N' -extra_logging '0' &quot;
  </code></pre>
  <blockquote>
  <p>dos charset 'CP850' unavailable - using ASCII The string starting: At line:1 char:106 + Set-ExecutionPolicy bypass -Force -Scope CurrentUser;C:\test.ps1  -lun &lt;&lt;&lt;&lt; 'B*= is missing the terminator: '. At line:1 char:110 + Set-ExecutionPolicy bypass -Force -Scope CurrentUser;C:\test.ps1  -lun 'B*= &lt;&lt;&lt;&lt; + CategoryInfo : ParserError: (B*=:String) [], ParentContainsErro rRecordException + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString</p>
  </blockquote>
  <p>The system cannot find the file specified. The system cannot find the file specified.</p>