-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
megathread: sudo should better support PowerShell #5
Comments
My two cents are... The less, the better. PowerShell already has some degree of support for Unix/Linux When PS invokes an external command and finds a scriptblock, it serializes it and adds special arguments to allow Standard I/O CLIXML serialization. It also auto-fallbacks to This makes gsudo has syntax sugar for shell detection, which makes the Regarding other syntaxes besides ScriptBlocks, such as
Another debatable reason for Lastly, when you run For all these reasons, plus the difficulty of per-user installation, I think shipping a What I suggest, is to add an auto-completion script to ms-sudo, to be added to each $PROFILE, like
This autocompletion script micro-spec, would work for Linux sudo too... So maybe is in the interest of the PowerShell team to implement ? I hope you find this insights useful. |
PowerShell should not be the shell of priority here. Rather, all "Shell Specific Commamnds" can be supported through |
I wonder if sudo is expected to work with shell builtins like PowerShell Cmdlets. https://superuser.com/questions/241129/why-wont-sudo-cd-work
Isn't that how sudo works on linux too? You should escape parts of the command if you want it to be executed in the sudo context, otherwise it is always computed before sudo is run 🤔 |
Currently, sudo only works for elevating an actual executable1. For something like
Get-ChildItem
(gci
) in PowerShell, that's not an executable, it's a cmdlet. We'll need a proper PowerShell module to be able to properly support various PowerShell scenarios.In the time being, we're working on the
sudo.ps1
script to provide a better experience for using sudo from PowerShell.Tasks
sudo !!
to run the last command #6Footnotes
It also supports CMD intrinsics, when run from CMD.exe. ↩
The text was updated successfully, but these errors were encountered: