title: PowerShell: Why does Out-File break long line into smaller lines?
body: <p>Try this little experiment. Create a file <code>Foo.txt</code> with a very long line of text (say 500 chars long) like this:</p>
  
  <pre><code>// Foo.txt
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
  </code></pre>
  
  <p>Now issue the following command:</p>
  
  <pre><code>$ Get-Content Foo.txt | Select-String "a" | Out-File Foo2.txt
  </code></pre>
  
  <p>You will find that the long line of string has been broken down into smaller lines in <code>Foo2.txt</code>. The length of each smaller line is the same as the console width.</p>
  
  <p>Why does <strong>Out-File</strong> break the long line into smaller line when the output is not headed to the console?</p>
  
  <p>And why does Out-File not break down the lines for the following command?</p>
  
  <pre><code>$ Get-Content Foo.txt | Out-File Foo3.txt
  </code></pre>