© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
I. WatersPowerShell for Beginnershttps://doi.org/10.1007/978-1-4842-7064-6_6

6. Arrays

Ian Waters1  
(1)
Bexhill, UK
 

Arrays are a list of objects such as strings and numbers, but they can contain any type of object you set up. Arrays can even contain a mix of different types of objects making them perfect for storing lots of values or objects in your scripts that need to be looped through or referred to later. Arrays and other types of lists in PowerShell are often referred to as collections, “a collection of objects.”

There are two common types of arrays you will see in PowerShell scripts. The first is the [Array] object, which is easy to use and of a fixed ...

Get PowerShell for Beginners: Learn PowerShell 7 Through Hands-On Mini Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.