title: Show tabular output in richtextbox
body: <p>Just installed the PowerShell Studio and I'm trying to view the results of some VMware commands in a richtextbox.</p>
  
  <p>When I run the <code>get-vm</code>, for example, it shows the data fine (I changed the font to Lucida Console- and it looks ok), regular <code>get-vm</code> results in the richtext box: </p>
  
  <pre class="lang-none prettyprint-override"><code>Name : xxx
  Cluster : xxx
  ESX Host : esx6
  Datastore : xxx
  MemoryGB : 8
  NumCpu : 2
  ProvisionedSpace(GB) : 282
  UsedSpace(GB) : 281
  OS : Microsoft Windows Server 2008 R2 (64-bit)
  </code></pre>
  
  <p>But when I try to run <code>(get-vm).Guest.Disks</code> the data not shown good in the richtextbox, it looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Capacity:192515403776,
  FreeSpace:43895230464,
  Path:E:\
  
  Capacity:75053920256,
  FreeSpace:12630409216,
  Path:C:\
  </code></pre>
  
  <p>when run it in regular powershell console it look like it should:</p>
  
  <pre class="lang-none prettyprint-override"><code>Volume Capacity(GB) FreeSpace(GB) % FreeSpace
  ------ ------------ ------------- -----------
  E:\    120          13            11
  C:\    120          15            12
  </code></pre>
  
  <p>The command line in PowerShell is:</p>
  
  <pre><code>((Get-VM $vm).Guest.disks) | Format-Table @{N="Volume";E={$_.Path}},
      @{N="Capacity(GB)";E={[System.Math]::Round($_.CapacityGB)};a="left"},
      @{N="FreeSpace(GB)";E={[System.Math]::Round($_.FreeSpaceGB)};a="left"},
      @{N="% FreeSpace";E={[math]::Round((100 * ($_.FreeSpacegb / $_.Capacitygb)),0)};a="left"} -auto |
    Out-String
  </code></pre>
  
  <p>the command line in the richtextbox is:</p>
  
  <pre><code>$richtextbox1.AppendText((Get-VM $text).Guest.disks) |
    Format-Table @{N="Volume";E={$_.Path}},
      @{N="Capacity(GB)";E={[System.Math]::Round($_.CapacityGB)};a="left"},
      @{N="FreeSpace(GB)";E={[System.Math]::Round($_.FreeSpaceGB)};a="left"},
      @{N="% FreeSpace";E={[math]::Round((100 * ($_.FreeSpacegb / $_.Capacitygb)),0)};a="left"} -auto |
   Out-String 
  </code></pre>
  
  <p>How can I get the results like it looks in the PowerShell console wheter is with richtextbox or any other control?</p>