February 2019
Intermediate to advanced
626 pages
15h 51m
English
A non-terminating error, a type of informational output, is written without stopping a script. Non-terminating errors are often the result of using the Write-Error command. The following function shows that processing continues after the error:
PS> function WriteError {>> Write-Host 'First'>> Write-Error 'Error'>> Write-Host 'Second'>> }PS> WriteErrorFirstWriteError : ErrorAt line:1 char:1+ WriteError+ ~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,WriteErrorSecond
Non-terminating errors are used to notify the user that something went wrong, but that it didn't necessarily warrant shutting down a script. A user ...
Read now
Unlock full access