title: How to trim all the lines in a file in powershell
body: <p>I am able trim all the contents in file </p>
  
  <pre><code>$lines=(Get-Content $BaselineFile)
  
  foreach ($line in $lines) { $line= $line.Trim() }
  </code></pre>
  
  <p>But how to put back the result in same file. ($Baselinefile)</p>