Each script provides a result value (so-called. exit code) at the end. This value influences the status of your computer and is interpreted as follows:
- exit 0 (or no exit code was delivered): Status OK (green)
- exit 1: Status warning (yellow)
- exit 2 or greater: Status problem (red)
At the same time, the latest issue line of your script is up to 2,048 characters long and stored and recorded in the history of your computer. Of course, you can subscribe to an alert that sends you the exit code and that issue via mail; that way, you can see immediately, if an automated script signals a warning or an issue.
Posted in: PowerShell