Arrays
For those that have never worked with arrays here is a great way to understand them: If a variable is a piece of paper then the stack of papers is an array. It’s a list of variables or objects, and every programming/scripting language has ways to store these variables or objects linearly so you can access them later via a number of different methods. So let us look at how we can create an array of string objects in powershell:
You can also add arrays together:
Example
$array = @("abc1", "abc2", "abc3")
$array2 = @("abc4", "abc5")
$array = $array + $array2
$array
Example
$array = @("abc1", "abc2", "abc3")
for ($i=0; $i -lt $array.length; $i++) {
$array[$i]
}