Pash-Project/Pash — pull request #198 by sburnicki (2014-04-10 11:44:43+00:00)
Title: Introduced Exit and Return Management

"exit" now allows to have an exit code which is properly handled.
In a script, the script simply exits and $LastExitCode will be set.
There is now also support for $? which simply indicates whether the last command was successful.
Outside a script, the complete process exits and the exit code of the process is set accordingly.

Also return statements now allow a value. However, this is nothing special
as
return 5;
is the same as
5;
return;
in Powershell.
ReferenceTests have been added to make sure this behavior fits PS.
The reference testing framework was adjusted for this and is now more powerfull to test even more things
like the PS/Pash process behavior.