To Sort Unique

sort -unique


1..100 | % { $_ % 5} | sort -unique

To Sort by a Property


sort -property "propertyName"


get-alias -def "get*" | sort -property definition | ft -property Name, Definition

Another example:

You can sort a file's content by the length of its lines by using:

cat $file | sort -property Length

To sort by file date descending (and pick only the top 10):

dir | sort lastwritetime -desc | select -f 10

To sort by a secondary column, instead pass a hash table as the property.

dir | sort -property @{Expression="lastwritetime";Descending=$true},@{Expression="Name";Descending=$false} | select -f 10

(Not quite as eloquent as you'd hope.)