Bird
0
0

What happens when you run this command?

medium📝 Command Output Q5 of 15
PowerShell - Error Handling
What happens when you run this command?
Get-ChildItem 'C:\nonexistentfolder' -ErrorAction SilentlyContinue
AScript stops with error
BCatch block triggered
CError message displayed, script continues
DNo error message, script continues
Step-by-Step Solution
Solution:
  1. Step 1: Understand -ErrorAction SilentlyContinue

    This suppresses error messages and continues script.
  2. Step 2: Analyze command behavior

    Since folder doesn't exist, no error shown, script continues silently.
  3. Final Answer:

    No error message, script continues -> Option D
  4. Quick Check:

    -ErrorAction SilentlyContinue = No error shown [OK]
Quick Trick: SilentlyContinue hides errors but script runs on [OK]
Common Mistakes:
  • Expecting error message
  • Thinking script stops

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes