This forum is closed. Thank you for your contributions.
I'd try asking for help over here.
https://social.technet.microsoft.com/Forums/en-US/home?forum=winserverpowershell
Regards, Dave Patrick .... Microsoft Certified Professional Microsoft MVP [Windows Server] Datacenter Management Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.
Hi All , Could you please explain how we are getting below output ? $list='one','two','two','three','four','five' $list |sort five four one three two two
You are storing the values in $list array and then sorting it while displaying with Sort command.
See these:
https://devblogs.microsoft.com/scripting/add-modify-verify-and-sort-your-powershell-array/ https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/sort-object?view=powershell-7
If the response helped, do "Mark as answer" and upvote it - Vaibhav