Summary: Easily use Windows PowerShell to reverse an array.
How can I use Windows PowerShell to reverse an array?
Pipe the array to the Sort-Object cmdlet and use the –Descending switch, for example:
$a = 1,2,3,4,5
$b = $a | sort -Descending
Summary: Easily use Windows PowerShell to reverse an array.
How can I use Windows PowerShell to reverse an array?
Pipe the array to the Sort-Object cmdlet and use the –Descending switch, for example:
$a = 1,2,3,4,5
$b = $a | sort -Descending
The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.
0 comments