Add a RequiresElevation Cmdlet Attribute #26641
Replies: 2 comments 1 reply
-
gsudo can work with Scriptblocks, It was very comfortable to create |
Beta Was this translation helpful? Give feedback.
-
|
I don't get what the attribute is supposed to do. Is it supposed to prevent use of the command if the session isn't elevated? Is PowerShell supposed to automatically do a sudo request before running the command? Is the idea that an automatic elevation can do more than what a manual sudo invocation would? (Transfer variable data back and forth between processes) If it's to hide the command from non-elevated sessions then I'd vote against that. Adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This would allow shipping Cmdlet's that require Elevation to use, but also allows non-elevated use. Though, we should recommend all cmdlets that require elevation are shipped in their own seperate submodule, bundled as part of the module, not released seperately, to reduce overall maintainence overheads.
This then would enables a
sudolike experience via a cross process sudo like experience, wit room to expand this more likesudoin the future.This then would partially/compeletely resolve comments like this
Whilst reducing friction from lack of
sudolike experience, like in the above linked issue.Suggested Direction of Travel (DirOfTrvl) for this,
Discussion (end of Jan) -> RFC (Jan -> April) -> Issue (Created same time as RFC) -> PR (Ideally Aug/September) -> Preview Release (Soon after PR) -> Backports as deemed needed & as soon as reasonably suitable.
Requires review from all Working Groups in some form or another, Language, Engine, Cmdlets, Remoting, Security, DSC, DevEx as well as Core Maintainers, Committee as well as inside and outside partners & the wider community.
We can bypass the need of the issue with linking the PR to RFC & Discussion in the PR title, context & summary & could have bypassed this with an RFC but I'd prefer someone else that feels comfortable take a stab at the RFC, please.
Beta Was this translation helpful? Give feedback.
All reactions