diff options
author | Davin Taddeo <davin@chef.io> | 2020-06-26 14:15:54 -0400 |
---|---|---|
committer | Davin Taddeo <davin@chef.io> | 2020-06-26 14:15:54 -0400 |
commit | c63702d2c00dd089438734cf4da83d65f70dbc3c (patch) | |
tree | 046103f048eae046e9e54a6290793d5dd20082ea /lib/chef | |
parent | d239cfb7e1360e037f75f4caad240cdb89c68aab (diff) | |
download | chef-c63702d2c00dd089438734cf4da83d65f70dbc3c.tar.gz |
update to resolve cspell errors
Signed-off-by: Davin Taddeo <davin@chef.io>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/windows_security_policy.rb | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb index 84a481d2d9..005ed4413a 100644 --- a/lib/chef/resource/windows_security_policy.rb +++ b/lib/chef/resource/windows_security_policy.rb @@ -81,10 +81,10 @@ class Chef description: "Policy value to be set for policy name." load_current_value do |desired| - secopt_values = load_secopts_state - output = powershell_out(secopt_values).stdout.strip + security_option_values = load_security_options_state + output = powershell_out(security_option_values).stdout.strip current_value_does_not_exist! if output.empty? - + state = Chef::JSONCompat.from_json(output) secvalue state[desired.secoption.to_s] end @@ -115,29 +115,30 @@ class Chef end action_class do - def load_secopts_state + def load_security_options_state <<-EOH C:\\Windows\\System32\\secedit /export /cfg $env:TEMP\\secopts_export.inf | Out-Null - $secopts_data = (Get-Content $env:TEMP\\secopts_export.inf | Select-String -Pattern "^[CEFLMNPR].* =.*$" | Out-String) + # cspell:disable-next-line + $security_options_data = (Get-Content $env:TEMP\\secopts_export.inf | Select-String -Pattern "^[CEFLMNPR].* =.*$" | Out-String) Remove-Item $env:TEMP\\secopts_export.inf -force - $secopts_hash = ($secopts_data -Replace '"'| ConvertFrom-StringData) + $security_options_hash = ($security_options_data -Replace '"'| ConvertFrom-StringData) ([PSCustomObject]@{ - RequireLogonToChangePassword = $secopts_hash.RequireLogonToChangePassword - PasswordComplexity = $secopts_hash.PasswordComplexity - LSAAnonymousNameLookup = $secopts_hash.LSAAnonymousNameLookup - EnableAdminAccount = $secopts_hash.EnableAdminAccount - PasswordHistorySize = $secopts_hash.PasswordHistorySize - MinimumPasswordLength = $secopts_hash.MinimumPasswordLength - ResetLockoutCount = $secopts_hash.ResetLockoutCount - MaximumPasswordAge = $secopts_hash.MaximumPasswordAge - ClearTextPassword = $secopts_hash.ClearTextPassword - NewAdministratorName = $secopts_hash.NewAdministratorName - LockoutDuration = $secopts_hash.LockoutDuration - EnableGuestAccount = $secopts_hash.EnableGuestAccount - ForceLogoffWhenHourExpire = $secopts_hash.ForceLogoffWhenHourExpire - MinimumPasswordAge = $secopts_hash.MinimumPasswordAge - NewGuestName = $secopts_hash.NewGuestName - LockoutBadCount = $secopts_hash.LockoutBadCount + RequireLogonToChangePassword = $security_options_hash.RequireLogonToChangePassword + PasswordComplexity = $security_options_hash.PasswordComplexity + LSAAnonymousNameLookup = $security_options_hash.LSAAnonymousNameLookup + EnableAdminAccount = $security_options_hash.EnableAdminAccount + PasswordHistorySize = $security_options_hash.PasswordHistorySize + MinimumPasswordLength = $security_options_hash.MinimumPasswordLength + ResetLockoutCount = $security_options_hash.ResetLockoutCount + MaximumPasswordAge = $security_options_hash.MaximumPasswordAge + ClearTextPassword = $security_options_hash.ClearTextPassword + NewAdministratorName = $security_options_hash.NewAdministratorName + LockoutDuration = $security_options_hash.LockoutDuration + EnableGuestAccount = $security_options_hash.EnableGuestAccount + ForceLogoffWhenHourExpire = $security_options_hash.ForceLogoffWhenHourExpire + MinimumPasswordAge = $security_options_hash.MinimumPasswordAge + NewGuestName = $security_options_hash.NewGuestName + LockoutBadCount = $security_options_hash.LockoutBadCount }) | ConvertTo-Json EOH end |