Here’s another neat feature we have added in PowerGUI 3.0 – ability to reset PowerShell runspace when you need to.
All you have to do is:
- Go to Debug menu, and click Reset Runspace.
And that will give you a nice new shiny PowerShell session with no variables or other changes left from your preceding work!
You can also make PowerGUI automatically reset runspace each time you start debugging if you:
- On the Tools menu, click Options,
- On Debug Options tab, select Reset PowerShell runspace each time debugging is started.
I somehow prefer manual method to automated one because quite often there is value in left-over variables (you get intellisense for example!), loaded modules, and so on. However, I can then manually reset the runspace before my final debug session to make sure the script works fine in a clean environment.
Either way, now you have both options at your command! Happy scripting!
(Screenshot taken from the original PowerGUI 3.0 announcement which lists a lot of other great features we shipped in that release)
This is a real time saver. I use it all the time. PowerGUI is by far my favoriate PowerShell Script Editor, especially with things llike #region – #endregion to collapse lines, intelli-sense to sho known options for adding members or completing commands. The amazing thing is that it is free.
Thanks Rich!