Module: Chef::Mixin::PowershellOut
- Includes:
- ShellOut, WindowsArchitectureHelper
- Included in:
- DSL::Universal, Provider::Package::Chocolatey
- Defined in:
- lib/chef/mixin/powershell_out.rb
Constant Summary
Constants included from ShellOut
Instance Method Summary collapse
-
#powershell_out(*command_args) ⇒ Mixlib::Shellout
Run a command under powershell with the same API as shell_out.
-
#powershell_out!(*command_args) ⇒ Mixlib::Shellout
Run a command under powershell with the same API as shell_out! (raises exceptions on errors).
Methods included from WindowsArchitectureHelper
#assert_valid_windows_architecture!, #disable_wow64_file_redirection, #forced_32bit_override_required?, #is_i386_process_on_x86_64_windows?, #node_supports_windows_architecture?, #node_windows_architecture, #restore_wow64_file_redirection, #valid_windows_architecture?, #with_os_architecture, #wow64_architecture_override_required?, #wow64_directory
Methods included from ShellOut
#run_command_compatible_options, #shell_out, #shell_out!, #shell_out_with_systems_locale, #shell_out_with_systems_locale!
Instance Method Details
#powershell_out(*command_args) ⇒ Mixlib::Shellout
Run a command under powershell with the same API as shell_out. The options hash is extended to take an “architecture” flag which can be set to :i386 or :x86_64 to force the windows architecture.
33 34 35 36 37 38 |
# File 'lib/chef/mixin/powershell_out.rb', line 33 def powershell_out(*command_args) script = command_args.first = command_args.last.is_a?(Hash) ? command_args.last : nil run_command_with_os_architecture(script, ) end |
#powershell_out!(*command_args) ⇒ Mixlib::Shellout
Run a command under powershell with the same API as shell_out! (raises exceptions on errors)
46 47 48 49 50 |
# File 'lib/chef/mixin/powershell_out.rb', line 46 def powershell_out!(*command_args) cmd = powershell_out(*command_args) cmd.error! cmd end |