Introducing Sudo for Windows We’re excited to announce the release of Sudo for Windows in Windows 11 Insider Preview Build 26052! Sudo for Windows is a new way for users to run elevated commands directly from an unelevated console session. It is an ergonomic and familiar solution for users who want ...
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.
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.
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.
FINALLY! It only took them WAY TOO MANY FUCKING YEARS! Good job catching up to literal decades-old practices, guys! How do you like living in the 1990s?
Man, I'll almost miss having to run a VNC session in parallel with WinRM to click on the UAC popup.
Legit didn’t realize until this news came out that windows didn’t have that same sort of “lawl, yes, I know what I’m doing and accept it might break my shit if I’m wrong” override access… but then I stopped using windows at 7 and only started again with 11 when my Linux beast died. (Temporary and migrating off already!)
I never really used cmd on windows, everything was gui… but I prefer terminal to gui on Linux (idk why, maybe just because it’s different and feels more in control. Also verbose logs are sexy).
Command line stuff on Windows (server) is in a pretty decent state now, imo. It's not perfect but more and more is manageable with powershell. It took some time to really grok that you're basically always working with objects but I'm a big fan and now quite dislike having to deal with just "text" output when I do something in Linux. (Probably also because I need to do a lot less in it so I'm not used to it as much)
Personally again I also like the naming scheme much more than how it's done in bash. If I need to do something I don't know I can search the command by using logical words. E.g. I want to change the properties of a service but don't know the command by heart I can use
Get-Command service
And I'll get a list of all commands that contain the word service.
When it comes to admin privileges you simply have the privileges of the account you used to start the session, which has its' own dangers I suppose since it requires you to maintain account hygiene yourself.
If you dig the structured output of powershell, you might want to check out Nushell. It’s a cross-platform shell that builds on powershell’s structured data approach but is much less verbose and, in my opinion, more intuitive than both powershell and Posix shells.
the most common uses of sudo are: pacman -Syu and apt update && apt upgrade. Windows needs proper CLI for the Microsoft Store or else windows sudo is quite lame.