PowerShell defines two different types of errors: terminating and non-terminating errors.
Each command in PowerShell may choose to raise either of these, depending on the operation.
PowerShell defines two different types of errors: terminating and non-terminating errors.
Each command in PowerShell may choose to raise either of these, depending on the operation.
A terminating error stops a pipeline processing; once an error is thrown, everything stops. A terminating error might appear as the result of using throw. In the following function, the second Write-Host statement will never execute:
PS> function ThrowError {
>> Write-Host 'First'
>> throw 'Error'
>> Write-Host 'Second'
>> }
PS> ThrowError
First
Error
At line:3 char:5
+ throw 'Error'
+ ~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Error:String...