title: How to redirect output?
body: <p>I am attempting to redirect output of a Powershell script to a txt file.</p>
  
  <p>In the Powershell window, I try:</p>
  
  <blockquote>
    <p>.\script.ps1 > list.txt</p>
  </blockquote>
  
  <p>But it does not help, all output still gets printed to the window.</p>
  
  <p>I then tried:</p>
  
  <blockquote>
    <p>.\script.ps1 >&amp; list.txt</p>
  </blockquote>
  
  <p>And got this error:</p>
  
  <pre><code>Missing file specification after redirection operator.
  At line:1 char:21
  + .\script.ps1 &gt; &lt;&lt;&lt;&lt; &amp; list.txt
      + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : MissingFileSpecification
  </code></pre>