Class: Chef::Knife::Winrm

Inherits:
Chef::Knife show all
Includes:
WinrmCommandSharedFunctions
Defined in:
lib/chef/knife/winrm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WinrmCommandSharedFunctions

included

Instance Attribute Details

#password=(value) ⇒ Object (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



37
38
39
# File 'lib/chef/knife/winrm.rb', line 37

def password=(value)
  @password = value
end

Instance Method Details

#execute_remote_commandObject



58
59
60
61
62
63
64
65
# File 'lib/chef/knife/winrm.rb', line 58

def execute_remote_command
  case @name_args[1]
  when "interactive"
    interactive
  else
    run_command(@name_args[1..-1].join(" "))
  end
end

#runObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/chef/knife/winrm.rb', line 46

def run
  STDOUT.sync = STDERR.sync = true

  configure_session
  exit_status = execute_remote_command
  if exit_status != 0
    exit exit_status
  else
    exit_status
  end
end