Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 27 lines (19 sloc) 0.644 kb
1f24cde @zenchild initial commit
authored
1 'winrm' can be used just like 'run'. For instance:
2
3 task :ipconfig, :roles => :winrm do
4 winrm 'ipconfig'
5 end
6
7 This will run ipconfig across all hosts in the :winrm role.
8
9 'winrm' will also accept a block exactly like 'run':
10
11 task :ipconfig, :roles => :winrm do
12 host_data = {}
13 winrm 'ipconfig' do |channel, stream, data|
14 host_data[channel[:host]] = "" unless host_data[channel[:host]].is_a?(String)
15 host_data[channel[:host]] << data
16 end
17
18 host_data.each_pair do |host,data|
19 puts "HOST: #{host}"
20 puts "---------------------------------------"
21 puts data
22 puts "---------------------------------------"
23 end
24 end
25
26
Something went wrong with that request. Please try again.