Exit-PSScript
Syntax
Section titled “Syntax”Exit-PSScript -exitcode <> -exitmessage <string>
Parameters
Section titled “Parameters”exitcode
The error code to end running of the script, see Error Codes for examples of predefined error codes
exitmessage
An message to add to the log
Example
Section titled “Example”Exit-PSScript 0