Skip to content
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

RunAs functionality #174

Closed
mobycorp opened this issue Nov 10, 2022 · 3 comments
Closed

RunAs functionality #174

mobycorp opened this issue Nov 10, 2022 · 3 comments
Labels

Comments

@mobycorp
Copy link

Details

Greetings,

First off, I love CliWrap! I have used it now in several of my projects. Thanks for your efforts! You've really done a great job with this project!

I have a need to run some PowerShell scripts that need to be run with admin privilege. I do not see anywhere in your APIs where I can specify the Verb parameter on the process object. Am I missing it or do I need to request this feature? If it is there, I'd love to know how to run a process as administrator.

Also, I check the progress that Ukraine is making against the Russian aggressors. I read with joy whenever I see that Russia is in retreat, having their helicopters and aircraft knocked from the skies, and seeing the Russian cowards getting their asses kicked! All of Ukraine is in my thoughts and prayers, my friend!

Cheers,
Steve Miller

@Tyrrrz
Copy link
Owner

Tyrrrz commented Nov 11, 2022

Hey there.

Unfortunately, running as admin is only possible via shell execute. This means that we won't be able to gain access to the process's output streams or do other things like kill the process on cancellation. This is a security limitation that prevents non-elevated processes from accessing information from elevated processes. In that state, 90% of CliWrap's functionality becomes effectively useless. Because of this, your best bet is to offer a prompt for the user to relaunch your own application with admin privileges, and then use CliWrap as you would normally to run other processes after that.

@mobycorp
Copy link
Author

mobycorp commented Nov 11, 2022 via email

@Tyrrrz
Copy link
Owner

Tyrrrz commented Nov 11, 2022

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants