September 23rd, 2013

PowerTip: Create Array with Five Numbers

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.