PowerShell ISE Freezes after executing WinForms
Hello, I've been having an issue with my PowerShell ISE. I am currently developing a PowerShell script that generates Windows Forms for gathering and displaying data. From what I can tell, the application runs and works great. However, after I execute the code once in the ISE (and close the app/stop execution gracefully); if I leave the ISE idle, for about 10 minutes, the ISE will freeze and I have to crash it with Task Manager. If winform code has not been executed, ISE works fine indefinitely. Thoughts on why my ISE constantly crashes when working on winform based scripts? Thanks.
  • Edited by bcehr Tuesday, July 28, 2015 3:17 PM
July 28th, 2015 3:17pm

jrv, I have been attempting to create tickets with Microsoft Support for this issue but have gotten no support from Microsoft. They claim it is a developer problem, even though it appears to definitely be a bug with the ISE (see link below).  Thoughts on how I can better approach this? 

Here is a link with others with this same issue:

http://stackoverflow.com/questions/30808084/using-windows-forms-locks-up-powershell-ise-minutes-after-script-has-terminated


  • Edited by bcehr Monday, August 31, 2015 1:49 PM
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 1:49pm

Jrv, thanks for the reply.  That was my original thought as well, but I literally went through the code and did a manual Remove-Variable for EVERY object in the code to cleanup and terminate everything and the ISE still freezes.  Running Get-Variable | Remove-Variable after script execution also still results in the ISE locking up after a short time.  I have also read other users having this same problem with even a simple winform application with a simple form with one control on it.  Wondering if possibly could be a bug in the ISE in relation to winforms? Or there something else in my code I could be missing?


  • Edited by bcehr Monday, August 31, 2015 6:41 PM
August 31st, 2015 6:40pm

Yeah, I have ran the script many times in the PowerShell console, leaving the console open with all variables intact for hours/days, the console never crashes, hangs, etc. However, the ISE will freeze within minutes, this should confirm there is a bug with the ISE?  Also many others out there have reported similar issues with the ISE when working with XML, WinForms and other type objects. I have tried again with MS support, but so far they are refusing to even look at the issue. Thanks!
  • Edited by bcehr 19 hours 21 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 7:50am

Hi,

This isn't exactly a solution to your actual issue, but have you tried alternate editors as a bandaid fix? I don't really do anything with forms, so I've had no issues with the ISE, but there are people out there who really seem to love PowerGUI.

Or PowerShell Studio, if you're willing to pony up for it.

September 3rd, 2015 8:00am

MS support will always look at the issue when you pay for support.

I will stress that this is not likely a bug.  Without your script it is impossible for anyone to even guess at what you are doing.

There are specific differences between the ISE and the CLI.  ISE is a GUI based editor and debugger.  It is not a target production  execution environment.

Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 11:03am

Yeah, I have ran the script many times in the PowerShell console, leaving the console open with all variables intact for hours/days, the console never crashes, hangs, etc. However, the ISE will freeze within minutes, this should confirm there is a bug with the ISE?  Also many others out there have reported similar issues with the ISE when working with XML, WinForms and other type objects. I have tried again with MS support, but so far they are refusing to even look at the issue. Thanks!
  • Edited by bcehr Thursday, September 03, 2015 11:50 AM
September 3rd, 2015 11:49am

Mike, I downloaded and tested the script with PowerGUI and ran into no problems. I ran the script in the PowerGUI Script Editor an entire day without a single crash. I guess this further supports that there is a core issue with PowerShell ISE when working with certain types of scripts since both PowerGUI and PowerShell ISE are GUI based editor and debuggers.
Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 8:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics