Elevating Console in PowerShell Studio

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 2 years and 6 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.
pgessford
Posts: 7
Last visit: Fri Sep 09, 2022 10:47 am
Has voted: 1 time

Elevating Console in PowerShell Studio

Post by pgessford »

Product, version and build: PowerShell Studio 2021 5.1.192
Operating system: WIN10
PowerShell version(s): 5.1.18362.1714 -and- 7.1.4

Good evening,

New to PowerShell studio so please bear with me. I am attempting to test my scripts from within PowerShell Studio (on-prem Exchange work that needs elevated permissions). On the Home tab of PowerShell studio, there is an icon that allows to enable/disable elevation. When I have the enable elevation button clicked and Run (CTRL+F5) the application (to output to the "Output" window", I am prompted for admin credentials. However, when I attempt to Run in Console (CTRL+F8), I do not get prompted for admin credentials, and the code runs as a standard user. Is the elevation feature only intended for the standard "Run?"
by brittneyr » Mon Aug 30, 2021 7:31 am
If the PowerShell Studio is running as an Administrator, then the embedded consoles with also run as administrator.
As of build 5.8.193, this is the only way to elevate the embedded consoles.
Go to full post
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Elevating Console in PowerShell Studio

Post by Alexander Riedel »

Yes, the elevation is only for run and debug. As elevation is per process it can only affect a new process. An existing process, like the embedded console cannot be elevated after the fact.
You can use Script Explorer to run a script in an elevated console. (right click on it)
I will talk to the team if a "Run in elevated console" can be added.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 7:24 am
Answers: 39
Been upvoted: 30 times

Re: Elevating Console in PowerShell Studio

Post by brittneyr »

If the PowerShell Studio is running as an Administrator, then the embedded consoles with also run as administrator.
As of build 5.8.193, this is the only way to elevate the embedded consoles.
Brittney
SAPIEN Technologies, Inc.
pgessford
Posts: 7
Last visit: Fri Sep 09, 2022 10:47 am
Has voted: 1 time

Re: Elevating Console in PowerShell Studio

Post by pgessford »

Thanks for the replies. That is exactly what I needed.
This topic is 2 years and 6 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.