summaryrefslogtreecommitdiff
path: root/spec/unit/provider/powershell_script_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/powershell_script_spec.rb')
-rw-r--r--spec/unit/provider/powershell_script_spec.rb11
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