From the course: PowerShell: Automating IT Administration

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Working with arrays and hash tables

Working with arrays and hash tables - PowerShell Tutorial

From the course: PowerShell: Automating IT Administration

Working with arrays and hash tables

- [Instructor] In the past few examples, we've imported data, we've created variables and populated them with numbers as well as text values. So I wanted to work through understanding arrays and hash tables, which are used for population of data. It can be small amounts or large, it really makes no difference. In a simple example here, we're creating a variable called numbers. I'm going to click run selection. And when I actually say numbers, it renders those numbers out. So a standard variable or array variable is going to return sets of information really based on what we put in there, and it'll comma separated. Now, what about if we wanted to select a specific value from that array? Now, in this example here, where we're using the numbers 1, 2, 3, 4, 5, you would potentially have to go through a for each statement to be able to pull out the one that you wanted to and say, "If this was equal to that, then do this."…

Contents