How do I access variable from command line after script finished

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 3 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
artisticcheese
Posts: 12
Last visit: Mon Sep 12, 2016 9:21 am

How do I access variable from command line after script finished

Post by artisticcheese »

I'm have unpleasant feeling that I will be told "it's not possible".
In ISE and every other GUI powershell editor if I have a script which I'm working on and say I put "$x=10" and then execute script, I can go back to console and check value of that variable after script stopped running. It does not work this way in PowerShell Studio or I'm missing something?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How do I access variable from command line after script finished

Post by davidc »

PowerShell Studio allows you to run your scripts directly in the console (Ctrl + Shift + F5) this way you can query the values at will and maintain a persistent session.

If you wish to use the internal PowerShell Studio host, you will need to set a breakpoint and Debug (F5) the script. When the debugger breaks, you can use the Debug Console or the Watch Panel to query the values. Note: PowerShell Studio will also retain a snapshot of the session variables at the last breakpoint when the debug session ends.

David
David
SAPIEN Technologies, Inc.
User avatar
artisticcheese
Posts: 12
Last visit: Mon Sep 12, 2016 9:21 am

Re: How do I access variable from command line after script finished

Post by artisticcheese »

Thanks. Is there a way to modify ribbon to have run in console as default Run method?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: How do I access variable from command line after script finished

Post by davidc »

You can't change the Ribbon itself, but you can add the "Run in Console" button to quick access bar by right-clicking on the button in the ribbon and selecting "Add to Quick Access Toolbar" from the context menu:
Add to Quick Access Toolbar.png
Add to Quick Access Toolbar.png (25.98 KiB) Viewed 5904 times
Quick Access Toolbar.png
Quick Access Toolbar.png (14.3 KiB) Viewed 5904 times
You can also use the Ctrl + Shift + F5 keyboard shortcut.

David
David
SAPIEN Technologies, Inc.
This topic is 8 years and 3 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.