I have a form that opens, with powershell, and also the console opens so you can see the verbose output while the forms operations are performed, based on what button is clicked. And if an error occurs that powershell recognizes, it stops as expected. But if something in my logic errors, the script continues to run as if nothing happened, so I’m trying to figure out how I can throw an error and stop the script from running without actually closing the console.
EXIT doesn’t seem to be the correct choice, because it will close the console, is there an alternate solution?