Class: VagrantWindows::Communication::WinRMShellFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-windows/communication/winrmshell_factory.rb

Overview

Factory class for generating new WinRMShell instances

Instance Method Summary collapse

Constructor Details

#initialize(windows_machine, winrm_finder) ⇒ WinRMShellFactory

Returns a new instance of WinRMShellFactory.

Parameters:



12
13
14
15
# File 'lib/vagrant-windows/communication/winrmshell_factory.rb', line 12

def initialize(windows_machine, winrm_finder)
  @windows_machine = windows_machine
  @winrm_finder = winrm_finder
end

Instance Method Details

#create_winrm_shellWinRMShell

Creates a new WinRMShell instance

Returns:



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/vagrant-windows/communication/winrmshell_factory.rb', line 20

def create_winrm_shell()
  WinRMShell.new(
    @winrm_finder.winrm_host_address(),
    @windows_machine.winrm_config.username,
    @windows_machine.winrm_config.password,
    {
      :port => @winrm_finder.winrm_host_port(),
      :timeout_in_seconds => @windows_machine.winrm_config.timeout,
      :max_tries => @windows_machine.winrm_config.max_tries
    })
end