title: I edited the background context menu in regedit to "open power shell here", how do I make it open as an admin?
body: <p>Value data: powershell.exe -admin -noexit -command Set-Location -literalPath '%V'</p>
  
  <p>-admin causes the powershell to close because it is not recognized. My question is how do I make powershell open as adminstrator from the context menu?</p>
  
  <p>I tried this function as per another stackoverflow answer, to test as to see whether I am running as admin:</p>
  
  <pre><code>
  function Test-Administrator  
  {  
      $user = [Security.Principal.WindowsIdentity]::GetCurrent();
      (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)  
  }
  
  
  Test-Administrator
  
  (it prints false)
  
  
  </code></pre>