You are here

PowerShell - Making Arrays

Creating an array in PowerShell is done using this syntax:

$myarray = @()

Then, assigning values to the array is done using "+=":

$myarray += "Trump"

You can refer to a position in the array by referring to it's index within the array:

$some_value = $myarray[1]

 

Categories: 
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
1 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer