diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-08-07 12:10:06 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-08-07 12:10:06 -0700 |
commit | 351905bc0a80e3b78bd0c928d3c3c2419b9f217d (patch) | |
tree | d43f393806675d9a12223fd597ff8f218da58bd6 /lib/chef/resource/powershell_script.rb | |
parent | 3501e592267a4f23577071eba90224d7f95e1199 (diff) | |
download | chef-resource-code-cleanup.tar.gz |
Simplify property definition.resource-code-cleanup
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
Diffstat (limited to 'lib/chef/resource/powershell_script.rb')
-rw-r--r-- | lib/chef/resource/powershell_script.rb | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb index 20c968b842..7699c0a976 100644 --- a/lib/chef/resource/powershell_script.rb +++ b/lib/chef/resource/powershell_script.rb @@ -25,19 +25,7 @@ class Chef provides :powershell_script, os: "windows" property :flags, String, - description: "A string that is passed to the Windows PowerShell command", - default: lazy { default_flags }, - coerce: proc { |input| - if input == default_flags - # Means there was no input provided, - # and should use defaults in this case - input - else - # The last occurrence of a flag would override its - # previous one at the time of command execution. - [default_flags, input].join(" ") - end - } + description: "A string that is passed to the Windows PowerShell command" property :convert_boolean_return, [true, false], default: false, @@ -88,15 +76,6 @@ class Chef def self.get_default_attributes(opts) { convert_boolean_return: true } end - - # Options that will be passed to Windows PowerShell command - # - # @returns [String] - def default_flags - # Set InputFormat to None as PowerShell will hang if STDIN is redirected - # http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected - "-NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None" - end end end end |