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

PowerTip: Reverse an Array with PowerShell

$
0
0

Summary: Learn how to reverse an array with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to reverse the order of an array stored in a variable?

Hey, Scripting Guy! Answer Use the static reverse method from the Array class, for example:

$a = @(1,2,3)

[array]::reverse($a)


Viewing all articles
Browse latest Browse all 3333

Trending Articles