February 2014
Intermediate to advanced
374 pages
8h 12m
English
In PowerCLI, you can create a list of objects. For example, "red","white","blue" is a list of strings. In PowerShell, a list of terms is called an array. An array can have zero or more objects. You can create an empty array and assign it to a variable:
PowerCLI C:\> $Array = @()
You can fill the array during creation using the following command line:
PowerCLI C:\> $Array = @("red","white")
You can use the += operator to add an element to an array:
PowerCLI C:\> $Array += "blue" PowerCLI C:\> $Array red white blue
If you want to retrieve a specific element of an array, you can use an index starting with 0 for the first element, 1 for the second element, and so on. If you want to retrieve an element from the tail of ...
Read now
Unlock full access