diff options
author | mwrock <matt@mattwrock.com> | 2020-10-07 11:02:54 -0700 |
---|---|---|
committer | mwrock <matt@mattwrock.com> | 2020-10-07 11:02:54 -0700 |
commit | 03f70aede103ffdea053affff3231c2b07fcebe9 (patch) | |
tree | 8c47753057f9aa81ef1da0e68f2f10b14b3b9341 /spec/unit/provider | |
parent | 0e268d038575d781ff396ce6307a20834ef52cae (diff) | |
download | chef-03f70aede103ffdea053affff3231c2b07fcebe9.tar.gz |
add interpreter to handle pwsh and powershell to powershell_scriptps_script
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'spec/unit/provider')
-rw-r--r-- | spec/unit/provider/powershell_script_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/provider/powershell_script_spec.rb b/spec/unit/provider/powershell_script_spec.rb index 1c49c52160..0bece73bd0 100644 --- a/spec/unit/provider/powershell_script_spec.rb +++ b/spec/unit/provider/powershell_script_spec.rb @@ -46,5 +46,16 @@ describe Chef::Provider::PowershellScript, "action_run" do expect(provider.command).to eq(expected) end + + it "uses pwsh when given the pwsh interpreter" do + new_resource.interpreter = "pwsh" + provider.send(:script_file_path=, "C:\\Temp\\Script.ps1") + + expected = <<~CMD.strip + "pwsh" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:\\Temp\\Script.ps1" + CMD + + expect(provider.command).to eq(expected) + end end end |