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

Have an option to skip using cmd.exe to execute commands #98

Open
rgl opened this issue Nov 3, 2019 · 2 comments
Open

Have an option to skip using cmd.exe to execute commands #98

rgl opened this issue Nov 3, 2019 · 2 comments

Comments

@rgl
Copy link

rgl commented Nov 3, 2019

Currently the command executable and arguments are executed indirectly by the cmd.exe shell but it would be very useful to have a way to skip it entirely, as that would simplify command execution without having to worry about the cmd.exe parsing rules (this way we "only" need to deal with the default / common CommandLineToArgvW rules).

From what I understood by reading the WinRM/WinRS protocol documentation available as part of [MS-WSMV]: Web Services Management Protocol Extensions for Windows Vista, if we use the http://schemas.microsoft.com/wbem/wsman/1/windows/shell/CustomShell ResourceURI (instead of http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd) we should be able to use any shell.

Have you tried this?

@masterzen
Copy link
Owner

No I never tried this. It might haven't been documented when I initially wrote this library.

@rgl
Copy link
Author

rgl commented Nov 4, 2019

In the mean time I've tried the obvious change of cmd to CustomShell and it did not work. I'm afraid its not that simple to change this, or even possible without implementing some kind of WinRM plugin that handles a CustomShell.

Another alternative would be to use PowerShell Remoting. There's a python library at https://github.com/jborean93/pypsrp (I didn't try to find a ruby equivalent) and by looking at it, the whole thing seems more complex than WinRS/cmd.

Have you tried to use/implement PowerShell Remoting in Ruby?

Another alternative, is to implement something simpler like PowerShell over ssh. Have you though about that?

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

No branches or pull requests

2 participants