I am trying to launch a PowerShell form after a process is finished by grabbing it's exit code. I want this form to basically just display some information in a text box, prompt user, etc. WITHOUT having the user click on a button. Is this possible? After researching for hours, I have not been able to find an answer. I have used a similar form, but all script processes need to be included after "add_click" and then end the script with $form.ShowDialog() . Any ideas how I can get the script to start automatically after the form is loaded?
After hours of testing and researching, I am finally able to get it to work with "Add_Shown." I just had to turn the script portion into a function and call that function via Add_Shown before loading the form. In this case, the function is called "Start-Script":