Non-terminating errors

A non-terminating error is written, a type of informational output, without stopping a script. Non-terminating errors are often the result of using Write-Error. The following function shows that processing continues after the error:

PS> function WriteError {
Write-Host 'First'
Write-Error 'Error'
Write-Host 'Second'
}
PS>WriteError
First
WriteError : Error
At line:1 char:1
+ WriteError
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,WriteError

Non-terminating errors are used to notify the user that something went wrong, but that it was not necessarily sufficient to warrant shutting down a script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.93.64