All the answers explain how to elevate your command in a new console host.
What amused me was that none of those tools behave like *nix sudo
, allowing to execute the command inside the current console.
So, I wrote: gsudo
Source Code https://github.com/gerardog/gsudo
Installation
Via scoop
- Install scoop if you don't already have it. Then:
scoop install gsudo
Or via Chocolatey
choco install gsudo
Manual instalation:
- Download the latest release, unzip, and add to path, from https://github.com/gerardog/gsudo/releases/
Demo