title: Formatting XML from PowerShell
body: <p>I have a PowerShell script that runs a stored procedure which returns XML. I then export the XML into a file but when I open the file, each line has 3 dots at the end and the line isn't complete. This is with using <code>out-file</code>.</p>
  
  <p>When I use <code>Export-Clixml</code> the XML that is returned from the query is dumped in a tag called <code>&lt;props&gt;</code> which is not one of my tags.</p>
  
  <p>I am unsure where to go from here to save my XML in it's original format.</p>
  
  <p>The PowerShell Script that I am using is similar to this:</p>
  
  <pre><code>$Date = Get-Date -format "yyyyMMdd_HHmm" 
  $File = "C:\Temp\MyFile"+$Date+".xml"
  
  $Query = "exec dbo.usp_MyProc"
  
  Invoke-Sqlcmd -Query $Query -database MyDatabase -ServerInstance MyServer | out-file $File -Encoding utf8 
  </code></pre>