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

PowerTip: Sort a PowerShell Array

$
0
0

Summary: Learn how to easily sort an array of numbers by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily sort an array of numbers stored in a variable?

Hey, Scripting Guy! Answer Use the Sort static method from the [array] .NET Framework class:

$a = 1,5,3,8,2,12

[array]::sort($a)


Viewing all articles
Browse latest Browse all 3333

Trending Articles