Skip to content

Instantly share code, notes, and snippets.

@xiaoyvr
Created April 3, 2019 03:57
Show Gist options
  • Save xiaoyvr/13494b5748a99c06bf8fc1b2f419cb2f to your computer and use it in GitHub Desktop.
Save xiaoyvr/13494b5748a99c06bf8fc1b2f419cb2f to your computer and use it in GitHub Desktop.
($ctx = $executioncontext.gettype().getfield("_context","nonpublic,instance").getvalue( $executioncontext)).gettype().getfield("_authorizationManager","nonpublic,instance").setvalue($ctx, (new-object System.Management.Automation.AuthorizationManager "Microsoft.PowerShell"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment