Closed xeor closed 8 years ago
Hmm, looks good, I will check this.
The logic seems sane. I haven't looked enough at the code base to know if passing the WinRMWebService object to a new WinRM::CommandExecutor is the 'correct' way to fix this. I think it is likely going down the right track.
I addressed this in PR #24
Cool, thank you @aaronmaxlevy
I saw a mention about this issue in https://github.com/NetDocuments/rd-winrm-plugin/issues/9, but I think a dedicated issue for it is better.
For every run, I am now getting an error;
This is mentioned on https://github.com/WinRb/WinRM#deprecated-methods as well.
I don't know enough ruby to feel comfortable sending in a pull-request, but I where able to get rid of the warning with some small tweeks to
winrmexe.rb
. Basically, addingexecutor = WinRM::CommandExecutor.new(winrm)
andexecutor.open
at L101 (https://github.com/NetDocuments/rd-winrm-plugin/blob/master/contents/winrmexe.rb#L101) and replacing theresult = winrm.powershell(command)
lines withexecutor.run_powershell_script
,...run_cmd
, andrun_wql
. And finally puttingexecutor.close
around L110..