Bird
0
0

What does the PowerShell automatic variable $Error store?

easy📝 Conceptual Q11 of 15
PowerShell - Error Handling
What does the PowerShell automatic variable $Error store?
AA list of recent errors encountered during the session
BAll successful command outputs
CUser input history
DSystem environment variables
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of $Error

    $Error automatically collects errors that occur during the PowerShell session.
  2. Step 2: Differentiate from other variables

    It does not store outputs, inputs, or environment variables, only errors.
  3. Final Answer:

    A list of recent errors encountered during the session -> Option A
  4. Quick Check:

    $Error stores errors [OK]
Quick Trick: Remember: $Error always holds recent errors [OK]
Common Mistakes:
  • Thinking $Error stores command outputs
  • Confusing $Error with environment variables
  • Assuming $Error stores user inputs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes