Class: VagrantPlugins::HyperV::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-windows-hyperv/monkey_patch/driver.rb

Direct Known Subclasses

VagrantHyperV::Driver

Instance Method Summary collapse

Instance Method Details

#add_swith_to_vm(options) ⇒ Object



38
39
40
41
42
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 38

def add_swith_to_vm(options)
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('add_switch_to_vm.ps1')
  execute(script_path, options)
end

#create_network_switch(options) ⇒ Object

New methods for network customization



20
21
22
23
24
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 20

def create_network_switch(options)
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('create_switch.ps1')
  execute(script_path, options)
end

#find_vm_switch_nameObject



32
33
34
35
36
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 32

def find_vm_switch_name
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('find_vm_switch_name.ps1')
  execute(script_path, {vm_id: vm_id})
end

#import(options) ⇒ Object

Override the existing import method to Override the import_vm.ps1 script



13
14
15
16
17
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 13

def import(options)
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('import_vm.ps1').to_s
  execute(script_path, options)
end

#list_net_adaptersObject



26
27
28
29
30
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 26

def list_net_adapters
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('get_adapters.ps1')
  execute(script_path, {})
end

#switch_exist(options) ⇒ Object



44
45
46
47
48
# File 'lib/vagrant-windows-hyperv/monkey_patch/driver.rb', line 44

def switch_exist(options)
  load_path = Pathname.new(File.expand_path("../scripts", __FILE__))
  script_path = load_path.join('switch_exist.ps1')
  execute(script_path, options)
end