Module: Chef_PowerShell::PowerShell::PowerMod

Extended by:
FFI::Library
Defined in:
lib/chef-powershell/powershell.rb

Constant Summary collapse

@@powershell_dll =
Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/Chef.PowerShell.Wrapper.dll"
@@ps_command =
""
@@ps_timeout =
-1

Class Method Summary collapse

Class Method Details

.do_workObject



86
87
88
89
90
# File 'lib/chef-powershell/powershell.rb', line 86

def self.do_work
  ffi_lib @@powershell_dll
  attach_function :execute_powershell, :ExecuteScript, %i{string int}, :pointer
  execute_powershell(@@ps_command, @@ps_timeout)
end

.set_ps_command(value) ⇒ Object



78
79
80
# File 'lib/chef-powershell/powershell.rb', line 78

def self.set_ps_command(value)
  @@ps_command = value
end

.set_ps_dll(value) ⇒ Object



74
75
76
# File 'lib/chef-powershell/powershell.rb', line 74

def self.set_ps_dll(value)
  @@powershell_dll = value
end

.set_ps_timeout(value) ⇒ Object



82
83
84
# File 'lib/chef-powershell/powershell.rb', line 82

def self.set_ps_timeout(value)
  @@ps_timeout = value
end