Reset Runspace

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
wokmer
Posts: 21
Last visit: Mon Sep 19, 2016 11:38 pm

Reset Runspace

Post by wokmer »

Is there a way to not reset the runspace after debugging? I think it's a handy feature to be able to inspect variables after a debugging session and see last values.

PowerShell ISE does this by default, PowerGUI Script Editor has an option for it:
2016-07-14_14-36-36.png
2016-07-14_14-36-36.png (19.43 KiB) Viewed 5690 times
Would be nice to have such an option in Studio!
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Reset Runspace

Post by DevinL »

When debugging the runspace is always reset for various reasons, mostly so you can verify the script will run on any machine without worrying about profiles or any preconfigured settings.

That being said, you can still inspect variables during and after debugging sessions a couple different ways:
- While debugging or after debugging you can mouse over variables in the text editor and it will show you it's last known value:
During_Debugging-1.png
During_Debugging-1.png (13.09 KiB) Viewed 5668 times
After_Debugging-1.png
After_Debugging-1.png (19.93 KiB) Viewed 5668 times
- You can add the variable to the Watch Panel by right clicking on the variable you wish to monitor and select Add to Watch, then during and after debug they appear in the Watch Panel:
Watch_Panel-1.png
Watch_Panel-1.png (10.29 KiB) Viewed 5668 times
DevinL
SAPIEN Technologies, Inc.
User avatar
wokmer
Posts: 21
Last visit: Mon Sep 19, 2016 11:38 pm

Re: Reset Runspace

Post by wokmer »

During debugging that obviously works, however on my system I cannot see last value when I hover over a variable and the Watch doesn't show anything either:
2016-07-15_09-42-11.png
2016-07-15_09-42-11.png (52.33 KiB) Viewed 5612 times
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Reset Runspace

Post by DevinL »

In that case I'll look into this a bit more closely but I need some more information.

In a previous post you mentioned that you're using the 64-bit version of Windows 10, and the 64 bit version of PowerShell Studio, can you provide me with the PowerShell version as well as the version number of PowerShell Studio?
DevinL
SAPIEN Technologies, Inc.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Reset Runspace

Post by DevinL »

Actually a real quick follow up:

I spoke with the developers and it turns out you have to hit a breakpoint for the values to be stored in the Watch Panel or in the mouse-over of the variable. So if you set a breakpoint after any point you'd like to know the value, it's stored in the Watch Panel and for the mouse-over.

Maintaining the runspace between debugging sessions is something we're looking at adding in the future and unfortunately I cannot provide a timetable as to when that will happen.
DevinL
SAPIEN Technologies, Inc.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.