3

I'm looking to do what's asked in this question: how to run a powershell script as administrator

The accepted answer says to use a shortcut. I'd like to do that, but when I get into Advanced Properties, everything is grayed out. How do I get around this?

1 Answers1

11

The trick is to edit the Shortcut target to add powershell.exe in front of the script path so it looks something like this:

powershell.exe -file "H:\Powershell\MyPoshScript.ps1"

Click OK, then go back into Properties and the "Run as Administrator" box will now be changeable.

(note: when I did this, Windows fixed the powershell.exe reference to the full path.

uSlackr
  • 9,053