Variables and Operators
Lesson 1 of 1
  1. 1
    Welcome to the “Variables and Operators” lesson of your PowerShell journey. Regardless of our use case, one inevitable aspect of programming is storing and manipulating data to serve our needs. Dat…
  2. 2
    Let’s start by discussing how variables work. In computer programming, variables are used to store a piece of data. In PowerShell, variables can store the results of commands and expressions like…
  3. 3
    In this exercise, we will discuss how variable types are handled in PowerShell and a few advanced ways to interact with variables, including enforcing types, creating multiple variables, and a few …
  4. 4
    Environment Variables store information related to the current environment, like the Operating System and user sessions like our current terminal. They are global variables, meaning we can access…
  5. 5
    Operators are used to perform specific operations on data, often stored in a variable. PowerShell offers multiple types of operators to manipulate data, including: - Arithmetic Operators - Assign…
  6. 6
    In this exercise, we will discuss the assignment and unary operators. #### Assignment Operators We can use assignment operators to assign, change, or append values to variables. The general synta…
  7. 7
    Comparison operators are used to compare values, test conditions, or filter elements of a collection, such as an array. They return a Boolean value, True or False, as a result. #### Equality Opera…
  8. 8
    In this exercise, we will take a look at logical operators. Logical operators allow us to combine multiple True/False expressions and statements into complex conditionals. Using the operators -and…
  9. 9
    Just like in mathematics, the order in which operators are evaluated matters in programming. Operator precedence in PowerShell is as follows: - ( ) - ++ – - ! -not - * / % - + - - -is -isnot -as -…
  10. 10
    Good job on making it to the end of Variables and Operators! In this lesson, we learned the following: - How to create variables in a variety of ways - Variable types and constrained variables - Li…

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