Class: IevmsRb

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

Instance Method Summary collapse

Instance Method Details

#cat(vbox_name, guest_path) ⇒ Object



4
5
6
7
# File 'lib/ievms/ievms_cli.rb', line 4

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

#cmd(vbox_name, command) ⇒ Object



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

def cmd(vbox_name,command)
  init vbox_name

  print @machine.run_command command
  print "\n"
end

#cmd_as_adm(vbox_name, command) ⇒ Object



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

def cmd_as_adm(vbox_name,command)
  init vbox_name

  print @machine.run_command_as_admin command
end

#copy_from(vbox_name, guest_path, local_path) ⇒ Object



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

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

#copy_to(vbox_name, local_path, guest_path) ⇒ Object



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

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

#copy_to_as_adm(vbox_name, local_path, guest_path) ⇒ Object



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

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

#ps(vbox_name) ⇒ Object



10
11
12
13
# File 'lib/ievms/ievms_cli.rb', line 10

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

#reboot(vbox_name) ⇒ Object



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

def reboot(vbox_name)
  init vbox_name
  print @machine.run_command "shutdown.exe /r /f /t 0"
end

#shutdown(vbox_name) ⇒ Object



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

def shutdown(vbox_name)
  init vbox_name
  print @machine.run_command "shutdown.exe /s /f /t 0"
end