Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Reverse Array

$
0
0

Summary: Easily use Windows PowerShell to reverse an array.

Hey, Scripting Guy! Question How can I use Windows PowerShell to reverse an array?

Hey, Scripting Guy! Answer 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


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>