Bird
0
0

What will be the output of this PowerShell script?

medium📝 Command Output Q13 of 15
PowerShell - Variables and Data Types
What will be the output of this PowerShell script?
$name = "Anna"
Write-Output $name
A$name
BWrite-Output $name
CAnna
DError: Variable not defined
Step-by-Step Solution
Solution:
  1. Step 1: Understand variable assignment

    $name is assigned the string "Anna".
  2. Step 2: Understand Write-Output behavior

    Write-Output prints the value stored in $name, which is "Anna".
  3. Final Answer:

    Anna -> Option C
  4. Quick Check:

    Variable value printed = A [OK]
Quick Trick: Write-Output prints variable's stored value [OK]
Common Mistakes:
  • Expecting variable name printed instead of value
  • Confusing output with command text
  • Thinking it causes an error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes