schisamo/em-winrm — Issue #2: feature/returnvalues in additon to stdout/stderr
Author: hh
Created: 2012-02-06 19:03:40+00:00
State: open

Might need to be able to get at return values.

```ruby

opts = {
:user => 'Administrator',
:pass => 'vagrant',
:host => 'localhost',
:port => 5985,
:basic_auth_only => true
}

http_transport = ( opts[:port].to_s=~/(443|5986)/ ? :ssl : :plaintext )
endpoint = "#{http_method}://#{opts[:host]}:#{opts[:port]}/wsman"
client = ::WinRM::WinRMWebService.new(endpoint, http_transport, opts)
remote_id = client.open_shell
command_id = client.run_command(remote_id, 'dir')
output = client.get_command_output(remote_id, command_id) do |out,error|
puts "STDOUT: #{out}" if out
puts "STDERR: #{error}" if error
end
puts "EXITCODE: #{output[:exitcode]}"
```