Open rgl opened 5 years ago
No I never tried this. It might haven't been documented when I initially wrote this library.
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?
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 thecmd.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 ofhttp://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd
) we should be able to use any shell.Have you tried this?