Class: VagrantSubutai::Util::Powershell

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-subutai/util/powershell.rb

Class Method Summary collapse

Class Method Details

.cmd_execute(command) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/vagrant-subutai/util/powershell.rb', line 19

def self.cmd_execute(command)
  c = [
      executable,
      "-NoLogo",
      "-NoProfile",
      "-NonInteractive",
      "-ExecutionPolicy", "Bypass",
      "-Command",
      command
  ].flatten.compact

  system(*c)
end

.execute(path, *args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/vagrant-subutai/util/powershell.rb', line 5

def self.execute(path, *args)
  command = [
      "powershell.exe",
      "-NoLogo",
      "-NoProfile",
      "-NonInteractive",
      "-ExecutionPolicy", "Bypass",
      "&('#{path}')",
      *args
  ].flatten

  system(*command)
end