What does the PowerShell cmdlet <code>Sort-Object</code> do?Sort-Object arranges items in a list or collection in order, either ascending or descending.
Sort-Object?Use the -Descending switch. Example: 1,5,3 | Sort-Object -Descending outputs 5 3 1.
Sort-Object to sort by a property name?Use the -Property parameter followed by the property name. Example: Get-Process | Sort-Object -Property CPU.
Sort-Object sort by multiple properties? How?Yes. Provide an array of property names to -Property. Example: Get-Process | Sort-Object -Property CPU, ID.
Sort-Object without any parameters?It sorts the input objects by their default property or value in ascending order.
Sort-Object?The -Descending switch sorts objects from highest to lowest.
Sort-Object?By default, Sort-Object sorts strings alphabetically in ascending order.
Get-Process | Sort-Object -Property CPU, IDThe command sorts first by CPU usage, then by process ID if CPU values are equal.
Ascending order is the default, so no parameter is needed.
Sort-Object sort?Sort-Object can sort any objects that have properties or values to compare.