summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavin Taddeo <davin@chef.io>2020-12-16 09:47:49 -0500
committerDavin Taddeo <davin@chef.io>2020-12-16 09:47:49 -0500
commit778ef633c566dfa0095fc6ce6b05682d49dc56d6 (patch)
tree24c2b761845317e09ba687d15544782b216b4370 /lib
parent9c5ae43f3dcb9b80115cce019f3bc403536fab5f (diff)
downloadchef-778ef633c566dfa0095fc6ce6b05682d49dc56d6.tar.gz
Updates to use powershell_exec and shell_out instead of powershell_out.
Signed-off-by: Davin Taddeo <davin@chef.io>
Diffstat (limited to 'lib')
-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 bf1999bc47..521dc94718 100644
--- a/lib/chef/resource/windows_security_policy.rb
+++ b/lib/chef/resource/windows_security_policy.rb
@@ -128,7 +128,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
@@ -160,10 +160,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