There is no sudo command in Windows. The nearest equivalent is “run as administrator.”
You can do this using the runas command with an administrator trust-level, or by right-clicking the program in the UI and choosing “run as administrator.”
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