title: Powershell sorting multiple columns and directions
body: <p>I've managed to get Powershell to sort multiple columns and in different directions;</p>
  
  <pre><code>$prop1 = @{Expression='Priority'; Descending=$true }
  
  $prop2 = @{Expression='Date'; Ascending=$true }
  
  (Import-Csv $BackUpDataPath"WaitList.csv") |
      Sort-Object $prop1, $prop2 |
      Export-Csv $BackUpDataPath"WaitList.csv" -NoType
  </code></pre>
  
  <p>My problem is that the Priority value is stored as string data and sorts as text so the output to the file is;</p>
  
  <pre><code>Date              Priority
  
  6/28/2016 16:46  2
  
  6/28/2016 16:59  2
  
  6/29/2016 15:27  11
  
  6/28/2016 16:42  1
  
  6/28/2016 16:49  1
  </code></pre>
  
  <p>I've tried <code>[int]$prop1</code> and similar ways to change it to an integer but it doesn't seem to work.  The Line <code>6/29/2016 15:27 11</code> should be first but it isn't.  Bare in mind as long as the #'s are less than 10 it sorts fine.</p>