Using chef's powershell_script provider how would I reference a file stored on the chef server instead of having the code defined in the same file? Basically how can I call on a .ps1 located on the server from a chef client?
You can call unsigned powershell scripts directly within powershell_script
, as long as your execution policy allows it, which Chef does by default.
powershell_script "run some script" do
code "c:/something/script.ps1"
end
If you want chef to deploy the script too, you can do it from the /files
section of the cookbook with cookbook_file
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With