Variables Pane in PS Studio 2015

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 1 month 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
jbudde
Posts: 5
Last visit: Thu Feb 24, 2022 7:18 am

Variables Pane in PS Studio 2015

Post by jbudde »

Hey again everyone -


I am wondering how to get the variables pane working? It should be able to display the current values of variables during any run (like powergui does) correct? Right now I can't get it to display anything, even when debugging. This is an incredibly useful feature in powergui all the time - not just during debugging - so I hope we can figure this out.



Product, version and build: Powershell Studio 2015, v4.2.99, (how do I find the build?)
32 or 64 bit version of product: 64
Operating system: Win 7 enterprise x64
32 or 64 bit OS: 64
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Variables Pane in PS Studio 2015

Post by Alexander Riedel »

Ok, so I will try to answer this as best as I can. There are some philosophical differences here.
PowerShell Studio (as well as PrimalScript) is a Script Development Environment. The PowerShell ISE (to use another example) is a learning tool and a console. The requirements for both are quite different.
When developing a script and debugging it, reproducing results and maintaining exact start conditions is paramount. Otherwise you just fudge things and your script will only work on your machine. That is why every time you run a script in PowerShell Studio (debugging or not) you get a new, fresh and empty runspace.
Which leads to the variables pane. It shows you the state of variables while debugging AND when stopped at a breakpoint. Outside of that context neither any variables nor their state can be displayed because they simply do not exist.
So if you just run your script or run it in the debugger WITHOUT any breakpoints, that variable window will just be empty.

Of course you are correct that sometimes it is helpful to examine the state of variables after a script ran. Specially when it didn't work, you may need to see what happened. Specially in this horrible cases where everything works fine when debugging step by step but not when you run a script just by itself.
In that case just run your script in the built-in console (Ctrl+Shift+F5). Then you can go in after the fact and examine everything in that console.
For those lurking and asking why this is not some fancy graphical do-it-all console rather than a bare-bones PowerShell console, again, this is to help you reproduce results. It will not help you if you test your script in some hyper-modern custom shell implementation we created. You need to always test in the environment you will ultimately run your scripts, which is usually the good old PowerShell console.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 8 years and 1 month 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.