you are viewing a single comment's thread
view the rest of the comments
[–] 25 points 2 years ago (1 child)

No, it really is super simple, just:

Set-HostElevatedPrivilege -SubstituteUser Administrator -Privilege [Microsoft.Automation.HostPrivilege]::new("Administrators", $(hostname)) -Credential $(Get-Credential) -Command "ping 1.1.1.1"
  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 2 years ago

    It's more complicated than that. It seems to be able to configurably block user input for sudo'd commands, retain the existing environment, ditch it and open a new window, and remember that you've sudo'd in the last minute or so.

  • source
  • parent