winrm 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -7,10 +7,15 @@ not limitted to, running batch scripts, powershell scripts and fetching WMI
7
7
  variables. For more information on WinRM, please visit Microsoft's WinRM
8
8
  site: http://msdn.microsoft.com/en-us/library/aa384426(v=VS.85).aspx
9
9
 
10
+ * This version does not currently support encryption of messages via
11
+ Kerberos so it is highly recommended to use SSL when configuring WinRM.
12
+ 'winrm quickconfig -transport:https'
13
+
10
14
 
11
15
  My Info:
12
16
  BLOG: http://distributed-frostbite.blogspot.com/
13
17
  Add me in LinkedIn: http://www.linkedin.com/in/danwanek
18
+ Find me on irc.freenode.net in #ruby-lang (zenChild)
14
19
 
15
20
  --------------------------------------------------------------------------
16
21
  --------------------------------------------------------------------------
@@ -35,7 +40,7 @@ gem install -r uuid
35
40
 
36
41
  EXAMPLE:
37
42
  require 'winrm'
38
- WinRM::WinRM.endpoint = 'http://mywinrmhost:5985/wsman'
43
+ WinRM::WinRM.endpoint = 'https://mywinrmhost:5986/wsman'
39
44
  WinRM::WinRM.set_auth('user','password')
40
45
  winrm = WinRM::WinRM.instance
41
46
  outputps = winrm.powershell 'script.ps1'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -23,6 +23,10 @@ module WinRM
23
23
  # Generic WinRM SOAP Error
24
24
  class WinRMWebServiceError < StandardError
25
25
  end
26
+
27
+ # Authorization Error
28
+ class WinRMAuthorizationError < StandardError
29
+ end
26
30
  end # SOAP
27
31
  end # WinRM
28
32
 
@@ -31,16 +31,17 @@ module WinRM
31
31
  @debug = File.new('winrm_debug.out', 'w')
32
32
  @debug.sync = true
33
33
  end
34
-
35
34
  end
36
35
 
37
36
  def self.set_auth(user,pass)
38
37
  @@user = user
39
38
  @@pass = pass
39
+ true
40
40
  end
41
41
 
42
42
  def self.set_ca_trust_path(file_or_dir)
43
43
  @@ca_trust_store = file_or_dir
44
+ true
44
45
  end
45
46
 
46
47
  # Turn off parsing and just return the soap response
@@ -106,9 +107,12 @@ module WinRM
106
107
  end
107
108
 
108
109
  def on_http_error(resp)
109
- puts "HTTP ERROR: #{resp.status}"
110
- puts "HEADERS=\n#{resp.headers}"
111
- puts "BODY=\n#{resp.body}"
110
+ case resp.status
111
+ when 401
112
+ raise WinRMAuthorizationError, "#{resp.headers}\n------\n#{resp.body}"
113
+ else
114
+ raise WinRMWebServiceError, "#{resp.headers}\n------\n#{resp.body}"
115
+ end
112
116
  end
113
117
 
114
118
 
@@ -12,6 +12,7 @@ describe "Test remote Powershell features via WinRM" do
12
12
  creds = JSON.load(File.open('spec/creds.json','r'))
13
13
  WinRM::WinRM.endpoint = creds['endpoint']
14
14
  WinRM::WinRM.set_auth(creds['user'],creds['pass'])
15
+ WinRM::WinRM.set_ca_trust_path('/etc/ssl/certs')
15
16
  WinRM::WinRM.instance
16
17
  end
17
18
 
@@ -12,6 +12,7 @@ describe "Test remote WQL features via WinRM" do
12
12
  creds = JSON.load(File.open('spec/creds.json','r'))
13
13
  WinRM::WinRM.endpoint = creds['endpoint']
14
14
  WinRM::WinRM.set_auth(creds['user'],creds['pass'])
15
+ WinRM::WinRM.set_ca_trust_path('/etc/ssl/certs')
15
16
  WinRM::WinRM.instance
16
17
  end
17
18
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Wanek
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-14 00:00:00 -05:00
17
+ date: 2010-10-22 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency