title: Running A PowerShell Script At A UNC Path With Admin Privilege From Shortcut
body: <p>I have created a PowerShell script to install some Features On Demand for our system administrators throughout our company. I have created a shortcut for the script and selected "Run As Administrator" in the advanced options. When I run the script directly it runs but errors state:</p>
  
  <pre><code>The requested operation requires elevation
  </code></pre>
  
  <p>If I run the script from the shortcut, UAC pops up to allow to run as administrator of which I hit Yes and then a Black CMD box pops up and then immediately closes. It doesn't display any part of my script and doesn't pause at the end like I have in the script. In the Target of the shortcut I have put:</p>
  
  <pre><code>powershell.exe -ExecutionPolicy Bypass
  </code></pre>
  
  <p>Still has the same problem.</p>
  
  <p>If I put the <code>powershell.exe -ExecutionPolicy</code> Bypass into the script it opens an Admin Powershell window on top of the original window but the script runs in the lower window. I can only assume that it launches the admin window back at <code>C:\Windows\System32</code></p>
  
  <p>Is there a way to run a command to start PowerShell as admin and go directly to my script on a UNC path? </p>
  
  <p>Something link this:</p>
  
  <p>Start-Process Powershell.exe -Verb runAs -File "\SERVER\Scripts\Script.ps1"</p>
  
  <p>Or is there a better way to get my shortcut to launch my scripts as an administrator to the script on the UNC path?</p>