Class: IevmsRb
- Inherits:
-
Thor
- Object
- Thor
- IevmsRb
- Defined in:
- lib/ievms/ievms_cli.rb
Instance Method Summary collapse
- #cat(vbox_name, guest_path) ⇒ Object
- #choco_inst(vbox_name, pkg) ⇒ Object
- #choco_uninst(vbox_name, pkg) ⇒ Object
- #cmd(vbox_name, command) ⇒ Object
- #cmd_as_adm(vbox_name, command) ⇒ Object
- #copy_from(vbox_name, guest_path, local_path) ⇒ Object
- #copy_to(vbox_name, local_path, guest_path) ⇒ Object
- #copy_to_as_adm(vbox_name, local_path, guest_path) ⇒ Object
-
#initialize(*args) ⇒ IevmsRb
constructor
A new instance of IevmsRb.
- #ps(vbox_name) ⇒ Object
- #pwrsh_as_adm(vbox_name, command) ⇒ Object
- #reboot(vbox_name) ⇒ Object
- #reset_ievms_taskmgr(vbox_name) ⇒ Object
- #restore_clean(vbox_name) ⇒ Object
- #shutdown(vbox_name) ⇒ Object
- #start(vbox_name) ⇒ Object
- #version ⇒ Object
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 [:verbose] @machine.timeout_secs = [:timeout] if [: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 [:gui] @machine.start end |
#version ⇒ Object
18 19 20 |
# File 'lib/ievms/ievms_cli.rb', line 18 def version print Ievms::VERSION end |