diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-02-28 16:49:40 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-04-05 12:24:06 -0700 |
commit | cb60b16d66363d27fa4b5dd23a3b79379b08d330 (patch) | |
tree | ac519cea72b59934867a66171ecb84feb8f747b1 /lib/chef/resource/windows_ad_join.rb | |
parent | 2f546b50bd67314251b0f62554fc71cbf6a7a29a (diff) | |
download | chef-powershell_exec.tar.gz |
Convert resources to powershell_execpowershell_exec
powershell_exec is significantly faster than powershell_script. We can use this now that we only support Windows 2012+
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/windows_ad_join.rb')
-rw-r--r-- | lib/chef/resource/windows_ad_join.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index 690cc914dc..432366bc28 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -73,12 +73,12 @@ class Chef cmd << " -Force" converge_by("join Active Directory domain #{new_resource.domain_name}") do - ps_run = powershell_out(cmd) + ps_run = powershell_exec(cmd) if ps_run.error? if sensitive? raise "Failed to join the domain #{new_resource.domain_name}: *suppressed sensitive resource output*" else - raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.stderr}" + raise "Failed to join the domain #{new_resource.domain_name}: #{ps_run.errors.first}" end end @@ -106,12 +106,12 @@ class Chef cmd << " -Force" converge_by("leave Active Directory domain #{node_domain}") do - ps_run = powershell_out(cmd) + ps_run = powershell_exec(cmd) if ps_run.error? if sensitive? raise "Failed to leave the domain #{node_domain}: *suppressed sensitive resource output*" else - raise "Failed to leave the domain #{node_domain}: #{ps_run.stderr}" + raise "Failed to leave the domain #{node_domain}: #{ps_run.errors.first}" end end |