PowerShell – Making Arrays

By | 2016-03-23

The basics of creating a PowerShell array and working with it.

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]

 

Leave a Reply

Your email address will not be published. Required fields are marked *