PowerPack tips and examples
Every PowerPack script must end by calling Exit-PSScript with an explicit exit code — the #### MAIN #### block of the script template already does this for you (Exit-PSScript 0 on success, or the caught exception’s HResult on an unhandled error), so you normally don’t call it yourself except to signal a controlled failure or one of the other predefined exit codes.