PowerShell - Making Arrays

ben himself's picture

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]

 

Tags: 

Categories: