Bird
0
0

Which of the following is the correct way to make a non-terminating error behave like a terminating error in PowerShell?

easy📝 Syntax Q12 of 15
PowerShell - Error Handling
Which of the following is the correct way to make a non-terminating error behave like a terminating error in PowerShell?
AUse the parameter <code>-ErrorAction Stop</code>
BUse the parameter <code>-ErrorAction Continue</code>
CUse the parameter <code>-ErrorAction SilentlyContinue</code>
DUse the parameter <code>-ErrorAction Ignore</code>
Step-by-Step Solution
Solution:
  1. Step 1: Recall the -ErrorAction parameter options

    The -ErrorAction parameter controls how errors behave; Stop makes non-terminating errors act as terminating.
  2. Step 2: Match the correct option

    -ErrorAction Stop forces the error to stop the script, unlike Continue or SilentlyContinue which allow continuation.
  3. Final Answer:

    Use the parameter -ErrorAction Stop -> Option A
  4. Quick Check:

    -ErrorAction Stop makes errors terminate [OK]
Quick Trick: Use -ErrorAction Stop to force termination on errors [OK]
Common Mistakes:
  • Using Continue or SilentlyContinue expecting termination
  • Confusing Ignore with Stop
  • Not knowing -ErrorAction controls error behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes