title: Capturing command output in Powershell as string instead of array of strings
body: <p>I am trying to capture the output of running an external command as a string, but the result returned by Powershell is always an array of strings. It is my understanding that Powershell splits the output on newlines (Windows or Unix line endings) and stores the result in an array, but I would like these newlines to be preserved since this is for an svn pre-commit hook script to detect if a committed file has mixed line endings. </p>
  
  <pre><code>$output = svnlook cat -t $transId -r $repos $filename
  </code></pre>
  
  <p>At this point line endings have been stripped, and <code>$output</code> is an array of strings, one per line of output.</p>
  
  <p>Redirecting to a file does not seem to work since this normalizes the line endings. How do you tell Powershell to not split a command's output?</p>
  
  <p>Thanks!</p>