Enable Elevation on per file or project basis

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 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
PGomersall
Posts: 131
Last visit: Thu Feb 15, 2024 12:14 pm

Enable Elevation on per file or project basis

Post by PGomersall »

Product: PowerShell Studio 2021 (64 Bit)
Build: v5.8.196
OS: Windows 10 Education (64 Bit)
Build: v10.0.22000.0

Is it possible to Enable Elevation on per file or project basis i.e. some kind of file\project setting? Not sure where this could get saved for a ps1 file. If not currently, but technically possible, could it be added as a feature request?
It would ne nice to not have to turn it on and off for specific tasks.
Regards,
Pete
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Enable Elevation on per file or project basis

Post by Alexander Riedel »

Just add
#Requires -RunAsAdministrator
to your script.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 2 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.