Learn PowerShell: Objects and Arrays
Learn to manipulate data by using and creating PowerShell objects and arrays.
StartObjects and Arrays
Lesson 1 of 1
- 1PowerShell is an object-oriented scripting language, meaning that much of the data in PowerShell is in the form of an object. In this lesson, we will dive into what an object exactly is, explore th…
- 2Many shells, such as the Linux Bash shell, have limited capabilities since they focus on strings as output. Plaintext output forces us to use other commands for additional functionality, such as fo…
- 3As stated in the previous exercise, properties are characteristics of an object. Just like a radius is an attribute that describes a circle and horsepower describes a car, we have properties that d…
- 4Methods are another piece of what makes up an object. Methods are the actions we can take on an object, just like how a circle can grow or shrink, or a car can accelerate or brake. When we use Get…
- 5Now that we are familiar with what an object is, what it’s made up of – properties and methods – and how we can work with them, it’s time to create our own objects! To create an object, we use th…
- 6A newer method of creating a custom object and easily adding properties to it is by using a hashtable. A hashtable holds multiple key-value pairs enclosed in @{ }. We can use these pairs to defi…
- 7Arrays are a data structure that holds a collection of items. Items can be of the same type or multiple types. We can think of arrays as a variable that can hold more than one value. Consider the…
- 8Now that we have an array, how do we access items from it? ##### Indexing The easiest way to access an item from an array is to use its index number. An index is the position number of an item….
- 9Some of the operators that work on variables also work on arrays. Let’s start with addition. ##### Adding Arrays The addition operator + concatenates – or combines – two arrays. PS > $fibonacci = …
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory