0
0
PowerShellscripting~5 mins

Terminating vs non-terminating errors in PowerShell - Quick Revision & Key Differences

Choose your learning style9 modes available
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?
AInformation message
BNon-terminating error
CWarning
DTerminating error
Which PowerShell block is used to handle terminating errors?
Atry { } catch { }
Bforeach { }
Cif { } else { }
Dswitch { }
What does the -ErrorAction parameter control?
ATerminating errors only
BNon-terminating errors only
CBoth terminating and non-terminating errors
DSyntax errors
If a command fails but the script continues, what type of error likely occurred?
ANon-terminating error
BTerminating error
CSyntax error
DRuntime error
Which error type requires explicit handling to prevent script stop?
AWarning
BNon-terminating error
CTerminating error
DInformation
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.