title: How to write Linux line breaks with PowerShell and System.IO.StreamWriter
body: <p>I need to write Linux-style line breaks from PowerShell using a <code>System.IO.StreamWriter</code> (for performance reasons):</p>
  
  <pre><code>$writer = New-Object System.IO.StreamWriter "path\to\file"
  $writer.WriteLine("{0};{1}", $timestamp, $value)
  </code></pre>
  
  <p>I'm close to solution : <code>System.IO.StreamWriter</code> has a <code>NewLine</code> property but it does not work as expected:</p>
  
  <pre><code>$writer.NewLine = "\n"
  $writer.WriteLine("{0};{1}", "23/12/2014", 45000)
  $writer.WriteLine("{0};{1}", "24/12/2014", 54000)
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>23/12/2014;45000\n24/12/2014;54000\n...
  </code></pre>