In my PowerShell script I display a form and I use the $Form.Close();
command to close it. It closes fine however when it does so it returns the word Cancel (it also does this if I manually close the form by pressing the top-right red-x).
This was OK when I ran the script in the console but now I'm using PS2EXE-GUI to run my scripts as a GUI executable when $Form.Close()
runs a pop-up msg appears with just the word Cancel which the user then has to click OK to get rid of. Is there any way to close a form silently please?