summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authormwrock <matt@mattwrock.com>2020-10-07 11:02:54 -0700
committermwrock <matt@mattwrock.com>2020-10-07 11:02:54 -0700
commit03f70aede103ffdea053affff3231c2b07fcebe9 (patch)
tree8c47753057f9aa81ef1da0e68f2f10b14b3b9341 /lib/chef/resource
parent0e268d038575d781ff396ce6307a20834ef52cae (diff)
downloadchef-03f70aede103ffdea053affff3231c2b07fcebe9.tar.gz
add interpreter to handle pwsh and powershell to powershell_scriptps_script
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/powershell_script.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb
index 7699c0a976..5c9b540f55 100644
--- a/lib/chef/resource/powershell_script.rb
+++ b/lib/chef/resource/powershell_script.rb
@@ -22,11 +22,18 @@ class Chef
class PowershellScript < Chef::Resource::WindowsScript
unified_mode true
+ set_guard_inherited_attributes(:interpreter)
+
provides :powershell_script, os: "windows"
property :flags, String,
description: "A string that is passed to the Windows PowerShell command"
+ property :interpreter, String,
+ default: "powershell",
+ equal_to: %w{powershell pwsh},
+ description: "The interpreter type, `powershell` or `pwsh` (PowerShell Core)"
+
property :convert_boolean_return, [true, false],
default: false,
description: <<~DESC
@@ -62,7 +69,6 @@ class Chef
def initialize(*args)
super
- @interpreter = "powershell.exe"
@default_guard_interpreter = resource_name
end