Product: PowerShell Studio 2020 5.7.179
Version: 64 Bit
OS: 64 Bit
I have created a simple GUI with only a Button to Exit. When click on the Button, the complied EXE file shoud be return a specific return code. When I understand correctly, I must using for that $script:ExitCode = XX.
I have added this to my function unter MainForm.psf
Code: Select all
$btn_Exit_Click={
#TODO: Place custom script here
$script:ExitCode = 99
$frm_Main.Close()
}
When I run in a cmd.exe my complied exe file, echo %errorlevel% returns everytime 0.
Is $script:ExitCode not working with compiled forms?
Best regards