SAM2009
asked on
How to sort PowerShell Format-List result?
Hi,
How to get the result of this cmd but sorted:
Get-Recipient -RecipientType MailContact -Identity "UserName" | fl
How to get the result of this cmd but sorted:
Get-Recipient -RecipientType MailContact -Identity "UserName" | fl
ASKER
No it doesn't sort. Same result.
Of course you need to tell which property to use for sorting. "Whatever" is a placeholder ;-).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
The Format-* cmdlets are (usually) meant to be the last element of the pipeline. They only format the output, basically destroying the original objects.
The solution: sort before the Format-* cmdlets.
Open in new window