summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authormwrock <matt@mattwrock.com>2020-10-01 13:19:36 -0700
committermwrock <matt@mattwrock.com>2020-10-01 16:32:54 -0700
commit66c5129dead55431dd038eee56af2ace93e810f1 (patch)
treee4e701aa69d7bcf15431ee83928f29a8f342a750 /lib/chef/mixin
parent18c528980b5a1f63296d82208024006982bf97d5 (diff)
downloadchef-66c5129dead55431dd038eee56af2ace93e810f1.tar.gz
remove redundant code
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/powershell_exec.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/chef/mixin/powershell_exec.rb b/lib/chef/mixin/powershell_exec.rb
index c81be13879..03b058edcf 100644
--- a/lib/chef/mixin/powershell_exec.rb
+++ b/lib/chef/mixin/powershell_exec.rb
@@ -117,14 +117,7 @@ class Chef
# The same as the #powershell_exec method except this will raise
# Chef::PowerShell::CommandFailed if the command fails
def powershell_exec!(script, interpreter = :powershell)
- case interpreter
- when :powershell
- cmd = Chef::PowerShell.new(script)
- when :pwsh
- cmd = Chef::Pwsh.new(script)
- else
- raise ArgumentError, "Expected interpreter of :powershell or :pwsh"
- end
+ cmd = powershell_exec(script, interpreter)
cmd.error!
cmd
end