Reset PowerShell Runspace in PowerGUI Script Editor

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:

  1. On the Tools menu, click Options,
  2. 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)

2 Responses to “Reset PowerShell Runspace in PowerGUI Script Editor”


  1. 1 richb4 September 1, 2011 at 7:47 pm

    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.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

September 2011
M T W T F S S
« Aug   Oct »
 1234
567891011
12131415161718
19202122232425
2627282930  

%d bloggers like this: