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