Using “Exit” to Communicate with Linux

by Dec 22, 2016

When a PowerShell script ends, you can run the command “Exit” and submit a numeric value. This has been good practice in the Windows world to set the “Error Level” that can be read by the caller (for example, a batch file or the scheduled task manager).

exit 99

Now that PowerShell is available on Linux as well, it can also be used to report back a status number to the calling Linux process.

Twitter This Tip! ReTweet this Tip!