So I just wrote my first PowerShell script that uses Windows Forms to create and display a GUI.
If I run the script in PowerShell ISE, or call the .ps1 from PowerShell command line directly, the script runs, the GUI appears and everything is fine. However, if I simply double-click on the .ps1 file to "launch" the script, the PowerShell prompt quickly opens and closes, and there's no GUI (it terminates immediately).
Am I missing something? Here's the last line in my script to make the GUI appear.
$crsc_main_form.ShowDialog()
Thank you.