Recall & Review
beginner
What does the $ symbol mean in PowerShell?
The $ symbol is used to create or reference a variable in PowerShell. It tells the shell that what follows is a variable name.
Click to reveal answer
beginner
How do you create a variable named 'name' with the value 'Alice' in PowerShell?
You write: $name = "Alice". This assigns the text 'Alice' to the variable $name.
Click to reveal answer
beginner
Can you use a variable without the $ symbol in PowerShell?
No. In PowerShell, you must use the $ symbol to access or create variables. Without it, PowerShell treats the word as a command or string.
Click to reveal answer
beginner
What happens if you write $number = 5 in PowerShell?
You create a variable named $number and store the number 5 in it. You can use $number later to get the value 5.
Click to reveal answer
beginner
How do you display the value of a variable in PowerShell?
Simply type the variable name with the $ symbol, like $name, and PowerShell will show its value.
Click to reveal answer
What does $var = 10 do in PowerShell?
✗ Incorrect
The $ symbol creates a variable. $var = 10 assigns the value 10 to the variable var.
How do you access the value stored in a variable named 'score'?
✗ Incorrect
In PowerShell, you use $ before the variable name to access its value.
Which of these is a valid variable name in PowerShell?
✗ Incorrect
Variable names can include letters, numbers (not at start), and underscores. $first_place is valid.
What will PowerShell do if you type $greeting without assigning it first?
✗ Incorrect
Unassigned variables in PowerShell return an empty string when accessed.
Which symbol is used to create variables in PowerShell?
✗ Incorrect
The $ symbol is used to create and reference variables in PowerShell.
Explain how to create and use a variable in PowerShell with an example.
Think about how you store and then use a label for a value.
You got /4 concepts.
What rules should you remember about variable names and usage in PowerShell?
Consider what characters are allowed and how to call variables.
You got /4 concepts.