Class: IevmsRb

Inherits:
Thor
  • Object
show all
Defined in:
lib/ievms/ievms_cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ IevmsRb

Returns a new instance of IevmsRb.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ievms/ievms_cli.rb', line 5

def initialize(*args)
  super

  #p args

  if args[0].count > 0
    @machine = Ievms::WindowsGuest.new args[0][0]
    @machine.verbose = true if options[:verbose]
    @machine.timeout_secs = options[:timeout] if options[:timeout]
  end
end

Instance Method Details

#cat(vbox_name, guest_path) ⇒ Object



23
24
25
# File 'lib/ievms/ievms_cli.rb', line 23

def cat(vbox_name,guest_path)
  print @machine.download_string_from_file_to_guest guest_path, true
end

#choco_inst(vbox_name, pkg) ⇒ Object



90
91
92
# File 'lib/ievms/ievms_cli.rb', line 90

def choco_inst(vbox_name,pkg)
  @machine.choco_install pkg
end

#choco_uninst(vbox_name, pkg) ⇒ Object



95
96
97
# File 'lib/ievms/ievms_cli.rb', line 95

def choco_uninst(vbox_name,pkg)
  @machine.choco_uninstall pkg
end

#cmd(vbox_name, command) ⇒ Object



69
70
71
72
# File 'lib/ievms/ievms_cli.rb', line 69

def cmd(vbox_name,command)
  print @machine.run_command command
  print "\n"
end

#cmd_as_adm(vbox_name, command) ⇒ Object



75
76
77
# File 'lib/ievms/ievms_cli.rb', line 75

def cmd_as_adm(vbox_name,command)
  print @machine.run_command_as_admin command
end

#copy_from(vbox_name, guest_path, local_path) ⇒ Object



64
65
66
# File 'lib/ievms/ievms_cli.rb', line 64

def copy_from(vbox_name, guest_path, local_path)
  @machine.download_file_from_guest(guest_path, local_path, false)
end

#copy_to(vbox_name, local_path, guest_path) ⇒ Object



59
60
61
# File 'lib/ievms/ievms_cli.rb', line 59

def copy_to(vbox_name,local_path, guest_path)
  @machine.upload_file_to_guest(local_path, guest_path, false)
end

#copy_to_as_adm(vbox_name, local_path, guest_path) ⇒ Object



54
55
56
# File 'lib/ievms/ievms_cli.rb', line 54

def copy_to_as_adm(vbox_name,local_path, guest_path)
  @machine.upload_file_to_guest_as_admin(local_path, guest_path, false)
end

#ps(vbox_name) ⇒ Object



28
29
30
# File 'lib/ievms/ievms_cli.rb', line 28

def ps(vbox_name)
  print @machine.run_command "tasklist"
end

#pwrsh_as_adm(vbox_name, command) ⇒ Object



85
86
87
# File 'lib/ievms/ievms_cli.rb', line 85

def pwrsh_as_adm(vbox_name,command)
  print @machine.run_powershell_cmd_as_admin command
end

#reboot(vbox_name) ⇒ Object



49
50
51
# File 'lib/ievms/ievms_cli.rb', line 49

def reboot(vbox_name)
  @machine.reboot
end

#reset_ievms_taskmgr(vbox_name) ⇒ Object



100
101
102
# File 'lib/ievms/ievms_cli.rb', line 100

def reset_ievms_taskmgr(vbox_name)
  @machine.end_ievms_task
end

#restore_clean(vbox_name) ⇒ Object



45
46
47
# File 'lib/ievms/ievms_cli.rb', line 45

def restore_clean(vbox_name)
  @machine.restore_clean_snapshot
end

#shutdown(vbox_name) ⇒ Object



33
34
35
# File 'lib/ievms/ievms_cli.rb', line 33

def shutdown(vbox_name)
  @machine.shutdown
end

#start(vbox_name) ⇒ Object



39
40
41
42
# File 'lib/ievms/ievms_cli.rb', line 39

def start(vbox_name)
  @machine.headless = false if options[:gui]
  @machine.start
end

#versionObject



18
19
20
# File 'lib/ievms/ievms_cli.rb', line 18

def version
  print Ievms::VERSION
end