Recall & Review
beginner
What is a terminating error in PowerShell?
A terminating error stops the script or command immediately. It means PowerShell cannot continue until the error is fixed or handled.
Click to reveal answer
beginner
What is a non-terminating error in PowerShell?
A non-terminating error reports a problem but lets the script or command keep running. It shows a warning or message but does not stop execution.
Click to reveal answer
intermediate
How can you catch a terminating error in PowerShell?
You can catch terminating errors using try { } catch { } blocks. The catch block runs only if a terminating error happens.
Click to reveal answer
intermediate
Which error type can be controlled by the -ErrorAction parameter in PowerShell?
The -ErrorAction parameter can control non-terminating errors by choosing to Continue, SilentlyContinue, Stop, or Ignore errors.
Click to reveal answer
beginner
Example: What happens if you run a command that tries to get a file that does not exist with default error settings?
PowerShell shows a non-terminating error message but continues running the script. The error is reported but does not stop execution.
Click to reveal answer
What type of error stops a PowerShell script immediately?
✗ Incorrect
Terminating errors stop the script immediately, unlike non-terminating errors which allow the script to continue.
Which PowerShell block is used to handle terminating errors?
✗ Incorrect
The try { } catch { } block is designed to catch and handle terminating errors.
What does the -ErrorAction parameter control?
✗ Incorrect
-ErrorAction controls how non-terminating errors behave, such as continuing or stopping.
If a command fails but the script continues, what type of error likely occurred?
✗ Incorrect
Non-terminating errors report problems but allow the script to continue running.
Which error type requires explicit handling to prevent script stop?
✗ Incorrect
Terminating errors stop the script unless handled with try/catch.
Explain the difference between terminating and non-terminating errors in PowerShell.
Think about whether the script stops or keeps running when an error happens.
You got /4 concepts.
Describe how you would handle a terminating error in a PowerShell script.
Focus on the PowerShell syntax for error handling.
You got /4 concepts.