I've managed to get Powershell to sort multiple columns and in different directions;
$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
My problem is that the Priority value is stored as string data and sorts as text so the output to the file is;
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
I've tried [int]$prop1 and similar ways to change it to an integer but it doesn't seem to work. The Line 6/29/2016 15:27 11 should be first but it isn't. Bare in mind as long as the #'s are less than 10 it sorts fine.