Support for all customers who have purchased or received a Productivity Pack Support product license. This forum does not offer a response time guarantee.
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.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Posts: 5
- Joined: Thu Aug 08, 2013 5:11 am
Ive created a sharepoint tool gui, and id love to be able to start it as administrator when people double click the .exe file.
I allready have the code to start form as admin:
Double-click the code block to select all.
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
However, i cant find where to place it so that it will be the first line in the file.
If i first export my project to a .ps1 file and add the above code on the top and run it in powershell it works fine, starting the program as an admin. But where should i place this code in PowerShell Studio 2012?
best regards Bjorn
- Posts: 6685
- Joined: Tue May 29, 2007 4:43 pm
If this is a product related question please post in the corresponding product forum.
If you are posting a general PowerShell question please post in the PowerShell forum.
This forum is for technical support for our community tools only.
SAPIEN Technologies, Inc.