Objects and Arrays
Lesson 1 of 1
  1. 1
    PowerShell 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…
  2. 2
    Many 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…
  3. 3
    As 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…
  4. 4
    Methods 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…
  5. 5
    Now 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…
  6. 6
    A 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…
  7. 7
    Arrays 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…
  8. 8
    Now 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….
  9. 9
    Some 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 = …
  10. 10
    Good job making it to the end of the Objects and Arrays lesson! Objects are everywhere in PowerShell, and arrays are one of the most popular data structures in programming. We hope you will feel …

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