title: PowerShell keep text formatting when reading in a file
body: <p>I believe this is a simple question, but I can't wrap my head around it. I want to do diagnostic commands in command shell on Windows. Like this:</p>
  
  <pre><code>   $cmd =  "ipconfig &gt;&gt; c:\test.txt"
  
     $message = Invoke-Expression($cmd)
  
     [String]$message = Get-Content c:\topsecret\testme.txt
  </code></pre>
  
  <p>Then I want to be able to read the file and keep the formatting and lastly publish it to pastebin via their API. I've tried, but I seem to lose the formatting no matter what I do. Is this possible to do?</p>