Sorting is a fairly common activity in PowerShell. One scenario I don’t see very often is a requirement to sort in two different directions. I have a list of users and their last logon dates – I want to sort users into alphabetical order (ascending) and lat logon into descending order.
We have to use a hash table for the fields and the direction if we want different sorting directions. Looks a bit messy but works a treat.