sort-object
Sort objects by property values. tldr-pages
On Windows
Windows
Sort objects by property values. Note: This command can only be used through PowerShell.
Sort the current directory by name
Get-ChildItem | Sort-ObjectIdentifySort the current directory by name descending
Get-ChildItem | Sort-Object -DescendingIdentifySort items removing duplicates
"a", "b", "a" | Sort-Object -UniqueIdentifySort the current directory by file length
Get-ChildItem | Sort-Object -Property LengthIdentifySort processes with the highest memory usage based on their working set (WS) size
Get-Process | Sort-Object -Property WSIdentify