Recall & Review
beginner
What is a variable in PowerShell?
A variable in PowerShell is a named container that stores data or information you want to use later in your script.
Click to reveal answer
beginner
Why do we use variables in scripts?
We use variables to save data so we can reuse it, change it, or refer to it easily without typing the data again and again.
Click to reveal answer
beginner
How do you create a variable in PowerShell?
You create a variable by using the $ sign followed by the variable name, like $name = "Alice".
Click to reveal answer
beginner
What kind of data can variables store?
Variables can store many types of data like numbers, text, lists, or even complex objects.
Click to reveal answer
beginner
What happens if you change the value of a variable?
The variable updates to hold the new data, replacing the old value. This helps scripts adapt and work with changing information.
Click to reveal answer
In PowerShell, what symbol starts a variable name?
✗ Incorrect
Variables in PowerShell always start with the $ symbol.
Why do we store data in variables?
✗ Incorrect
Variables let us reuse and update data without retyping it.
Which of these can NOT be stored in a PowerShell variable?
✗ Incorrect
Variables store data like text, numbers, and lists, but commands are run, not stored as data.
What happens when you assign a new value to a variable?
✗ Incorrect
Assigning a new value replaces the old value in the variable.
Which is a correct way to create a variable named 'age' with value 30?
✗ Incorrect
Variables start with $ and are assigned values with =, like $age = 30.
Explain in your own words why variables are important in scripting.
Think about how you remember things to use later.
You got /4 concepts.
Describe how you create and update a variable in PowerShell.
Remember the $ symbol and the equals sign.
You got /3 concepts.