Microsoft is bringing Linux's 'sudo' command into Windows 11 with latest preview build
Microsoft has announced the integration of sudo, a command prevalent on Linux and macOS systems for obtaining administrator access, into Windows with the Windows 11 Insider Preview Build 26052. This move follows Microsoft's previous embrace of Linux during the Windows 10 era, where they introduced a virtualized subsystem to provide users and developers with a genuine Linux command line within the Windows environment.
According to Microsoft, “Sudo for Windows is a new way for users to run elevated commands directly from an unelevated console session.” This solution is designed to be ergonomic and familiar to users wishing to elevate a command without the need to open a new elevated console.
To activate Sudo for Windows, users should go to the Settings For Developers page in Windows Settings and switch on the “Enable Sudo” option. Alternatively, Sudo for Windows can be enabled by running the command sudo config --enable in an elevated console session.
Microsoft is currently in the process of open-sourcing Sudo for Windows. More information about their plans will be shared in the upcoming months.



Comments
Today it's just a matter of using gsudo, I've been using it for years. It can be installed by winget: "winget install gerardog.gsudo". But it's really cool that they bring that native into the system.
Reminder that Microsoft created winget which can make installing and updating software a lot easier, but they made it not installed by default and a pain to install outside of the Windows Store. So I guess if I need sudo on Windows, I'll install it using scoop.