Method: Chef::Mixin::PowershellOut#powershell_out
- Defined in:
- lib/chef/mixin/powershell_out.rb
#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.
34 35 36 37 38 39 40 41 42 |
# File 'lib/chef/mixin/powershell_out.rb', line 34 def powershell_out(*command_args) script = command_args.first = command_args.last.is_a?(Hash) ? command_args.last : nil interpreter = command_args[1].is_a?(Symbol) ? command_args[1] : :powershell raise ArgumentError, "Expected interpreter of :powershell or :pwsh" unless %i{powershell pwsh}.include?(interpreter) run_command_with_os_architecture(script, interpreter, ) end |