you are viewing a single comment's thread
view the rest of the comments
[–] 57 points 2 years ago (3 children)

It's weird that its just "sudo" and not "Get-Admin-Acces"

  • source
  • hideshow 6 child 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
  • [–] 22 points 2 years ago

    It might just be an alias to a function similar to what you posted. Because like you can do curl but it really just calls invoke-webrequest, or ls for Get-ChildItem.

    It is kind of weird that I took him this long to put this out though. I imagine a lot of people wrote their own version of this and it all probably very nearly the exact same.

  • source
  • parent
  • [–] 3 points 2 years ago (1 child)

    Indeed. The name doesn't follow the conventions of other commands in Windows/Powershell at all. And it is inconsistente too. "sudo" stands for "super user do", but in Windows the notion of super user is called administrator. This will likely also cause confusion with people googling for "sudo" and getting to *nix related pages instead.

  • source
  • parent
  • hideshow 2 child comments