powershell exit script code example
Example 1: powershell enable scripts
Set-ExecutionPolicy unrestricted
Example 2: powershell exit code
function ExitWithCode { param($exitcode) $host.SetShouldExit($exitcode); exit }
Example 3: powershell script run
./myscript.ps1 //if is in the current directory
c:/scripts/myscript.ps1 //if you want to use the full path
&"C:/my path with space/myscript.ps1" //if your path has spaces