title: Exporting powershell output to text file
body: <p>I have a foreach loop inside my powershell script with prints $output on the shell during each iteration. There are lot many outputs and the number of entries that the shell can display is limited. I am looking to export the output to a text file. I know how to do it in command line. How is it possible in a powershell though? </p>
  
  <p>FYI, I am using a batch script from the command line to run the powershell script as </p>
  
  <pre><code>powershell c:\test.ps1 c:\log.log 
  </code></pre>