PowerTip: Create Array with Five Numbers

Doctor Scripto

Summary: Easily create an array that contains five numbers with Windows PowerShell.

 Hey, Scripting Guy! Question How can I use Windows PowerShell to easily create an array that contains five numbers?

Hey, Scripting Guy! Answer Use the Range operator and assign the results to a variable:

$a = 1..5

0 comments

Discussion is closed.

Feedback usabilla icon