summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavin Taddeo <davin@chef.io>2020-12-16 09:47:49 -0500
committerTim Smith <tsmith84@gmail.com>2021-09-17 08:27:12 -0700
commitdf6131e5d0e215a3e91ed2346a07c74a6dc89c9b (patch)
tree3135b9ecd7632202c6eb70b21fdadc87bc26de87
parent9214fedfa2682efdabd0b49e88413e2cf99c3d0e (diff)
downloadchef-df6131e5d0e215a3e91ed2346a07c74a6dc89c9b.tar.gz
Updates to use powershell_exec and shell_out instead of powershell_out.
Signed-off-by: Davin Taddeo <davin@chef.io>
-rw-r--r--lib/chef/resource/windows_security_policy.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb
index 3c3229a18d..bec15e5c55 100644
--- a/lib/chef/resource/windows_security_policy.rb
+++ b/lib/chef/resource/windows_security_policy.rb
@@ -131,7 +131,7 @@ class Chef
file_path = file.path.gsub("/", '\\')
cmd = "C:\\Windows\\System32\\secedit /configure /db C:\\windows\\security\\new.sdb /cfg #{file_path} /areas SECURITYPOLICY"
end
- powershell_out!(cmd)
+ shell_out!(cmd)
file.unlink
end
end
@@ -163,10 +163,9 @@ class Chef
MinimumPasswordAge = $security_options_hash.MinimumPasswordAge
NewGuestName = $security_options_hash.NewGuestName
LockoutBadCount = $security_options_hash.LockoutBadCount
- }) | ConvertTo-Json
+ })
CODE
- output = powershell_out(powershell_code)
- Chef::JSONCompat.from_json(output.stdout)
+ powershell_exec(powershell_code).result
end
end
end