Which of the following is the correct syntax to display the number 10 in PowerShell?
easy📝 Syntax Q3 of 15
PowerShell - Basics and Environment
Which of the following is the correct syntax to display the number 10 in PowerShell?
AWrite-Output 10
BWrite-Output "10"
CWrite-Output (10)
DAll of the above
Step-by-Step Solution
Solution:
Step 1: Check each option's validity
Write-Output 10 outputs number 10 directly. Write-Output "10" outputs string "10" which also displays 10. Write-Output (10) uses parentheses which is valid syntax.
Step 2: Confirm all produce output 10
All options display 10 on the console correctly.
Final Answer:
All of the above -> Option D
Quick Check:
All syntaxes display 10 correctly [OK]
Quick Trick:Numbers can be output as numbers or strings [OK]
Common Mistakes:
Thinking only one syntax works
Confusing parentheses usage
Master "Basics and Environment" in PowerShell
9 interactive learning modes - each teaches the same concept differently