winrm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ $: << File.dirname(__FILE__) + '/../../lib/'
2
+ require 'kconv'
3
+ require 'winrm'
4
+ require 'json'
5
+
6
+ # To run this test put a file called 'creds.json' in this directory with the following format:
7
+ # {"user":"myuser","pass":"mypass","endpoint":"http://mysys.com/wsman"}
8
+
9
+
10
+ describe "Test remote Powershell features via WinRM" do
11
+ before(:all) do
12
+ creds = JSON.load(File.open('spec/creds.json','r'))
13
+ WinRM::WinRM.endpoint = creds['endpoint']
14
+ WinRM::WinRM.set_auth(creds['user'],creds['pass'])
15
+ WinRM::WinRM.instance
16
+ end
17
+
18
+ it 'should run a test Powershell script' do
19
+ winrm = WinRM::WinRM.instance
20
+ output = winrm.powershell('spec/test.ps1')
21
+ output[:stdout].should_not be_empty
22
+ end
23
+
24
+ end
@@ -0,0 +1,5 @@
1
+ spec/powershell_tests.spec
2
+ spec/wql_tests.spec
3
+ --format
4
+ nested
5
+ --color
@@ -0,0 +1,14 @@
1
+ echo 'Getting the Environment'
2
+ echo '------------------------------------------------'
3
+ Get-ChildItem Env:
4
+
5
+ $diameter = 4.5
6
+
7
+ $area = [Math]::pow([Math]::PI * ($diameter/2), 2)
8
+
9
+ echo '------------------------------------------------'
10
+
11
+ echo 'Testing the Math library'
12
+ echo '------------------------------------------------'
13
+
14
+ echo "Circle Area: $area"
@@ -0,0 +1,23 @@
1
+ $: << File.dirname(__FILE__) + '/../../lib/'
2
+ require 'kconv'
3
+ require 'winrm'
4
+ require 'json'
5
+
6
+ # To run this test put a file called 'creds.json' in this directory with the following format:
7
+ # {"user":"myuser","pass":"mypass","endpoint":"http://mysys.com/wsman"}
8
+
9
+
10
+ describe "Test remote WQL features via WinRM" do
11
+ before(:all) do
12
+ creds = JSON.load(File.open('spec/creds.json','r'))
13
+ WinRM::WinRM.endpoint = creds['endpoint']
14
+ WinRM::WinRM.set_auth(creds['user'],creds['pass'])
15
+ WinRM::WinRM.instance
16
+ end
17
+
18
+ it 'should run a WQL query against Win32_Service' do
19
+ winrm = WinRM::WinRM.instance
20
+ output = winrm.wql('select Name,Status from Win32_Service')
21
+ output.should_not be_empty
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: winrm
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Dan Wanek
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-08-19 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: handsoap
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: nokogiri
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :runtime
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: httpclient
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ type: :runtime
58
+ version_requirements: *id003
59
+ - !ruby/object:Gem::Dependency
60
+ name: rubyntlm
61
+ prerelease: false
62
+ requirement: &id004 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ type: :runtime
71
+ version_requirements: *id004
72
+ - !ruby/object:Gem::Dependency
73
+ name: uuid
74
+ prerelease: false
75
+ requirement: &id005 !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ type: :runtime
84
+ version_requirements: *id005
85
+ description: " Ruby library for Windows Remote Management\n"
86
+ email: dan.wanek@gmail.com
87
+ executables: []
88
+
89
+ extensions: []
90
+
91
+ extra_rdoc_files:
92
+ - README
93
+ - COPYING.txt
94
+ files:
95
+ - COPYING.txt
96
+ - README
97
+ - Rakefile
98
+ - VERSION
99
+ - lib/extensions/string.rb
100
+ - lib/soap/exceptions/exceptions.rb
101
+ - lib/soap/soap_provider.rb
102
+ - lib/soap/winrm_service.rb
103
+ - lib/winrm.rb
104
+ - preamble
105
+ - test/spec/powershell_tests.spec
106
+ - test/spec/spec.opts
107
+ - test/spec/test.ps1
108
+ - test/spec/wql_tests.spec
109
+ has_rdoc: true
110
+ homepage: http://github.com/zenchild/WinRM
111
+ licenses: []
112
+
113
+ post_install_message:
114
+ rdoc_options:
115
+ - -x
116
+ - test/
117
+ - -x
118
+ - examples/
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ segments:
127
+ - 1
128
+ - 8
129
+ - 7
130
+ version: 1.8.7
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ requirements: []
140
+
141
+ rubyforge_project:
142
+ rubygems_version: 1.3.7
143
+ signing_key:
144
+ specification_version: 3
145
+ summary: Ruby library for Windows Remote Management
146
+ test_files: []
147
+