Chef Powershell Run from File

Derongan

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?

Matt

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Passing variables from chef to powershell

From Java

How to run a PowerShell script from a batch file

From Dev

Run parameters in a Powershell script from a batch file

From Dev

Run parameters in a Powershell script from a batch file

From Dev

Chef cookbook_file run script if updated

From Dev

Chef - Returning a variable from powershell script

From Dev

Chef - Skip resources from status of previous run

From Dev

Run file with Powershell

From Dev

Chef powershell_script passes but does not actually run script

From Java

In a CMD batch file, can I determine if it was run from powershell?

From Dev

Run a C# .cs file from a PowerShell Script

From Dev

How do I run a PowerShell script on a file from the context menu?

From Dev

Parameters with spacebars parsed incorrectly for a powershell script run from a batch file

From Dev

Run a Powershell script from Batch file with elevated privileges?

From Dev

How to run .sql file using sqlplus from powershell

From Dev

Run veracrypt from powershell

From Dev

Access a Chef data bag from an attributes file

From Dev

Copy file from chef client node to workstation

From Dev

Get one file from git using chef

From Dev

Generate then read contents from a file chef

From Dev

Chef: append to an exsting file from an "erb" template

From Dev

Run Powershell script from inside other Powershell script with dynamic redirection to file

From Dev

Run a .cmd file through PowerShell

From Dev

Run Registry File Remotely with PowerShell

From Dev

How to run chef without chef server (chef solo/chef zero)

From Dev

How to transform from erb file to my config file only in Chef?

From Dev

Powershell 'runspace' does not run from the Powershell console

From Dev

Run Powershell from C#

From Dev

run powershell command from cmd

Related Related

  1. 1

    Passing variables from chef to powershell

  2. 2

    How to run a PowerShell script from a batch file

  3. 3

    Run parameters in a Powershell script from a batch file

  4. 4

    Run parameters in a Powershell script from a batch file

  5. 5

    Chef cookbook_file run script if updated

  6. 6

    Chef - Returning a variable from powershell script

  7. 7

    Chef - Skip resources from status of previous run

  8. 8

    Run file with Powershell

  9. 9

    Chef powershell_script passes but does not actually run script

  10. 10

    In a CMD batch file, can I determine if it was run from powershell?

  11. 11

    Run a C# .cs file from a PowerShell Script

  12. 12

    How do I run a PowerShell script on a file from the context menu?

  13. 13

    Parameters with spacebars parsed incorrectly for a powershell script run from a batch file

  14. 14

    Run a Powershell script from Batch file with elevated privileges?

  15. 15

    How to run .sql file using sqlplus from powershell

  16. 16

    Run veracrypt from powershell

  17. 17

    Access a Chef data bag from an attributes file

  18. 18

    Copy file from chef client node to workstation

  19. 19

    Get one file from git using chef

  20. 20

    Generate then read contents from a file chef

  21. 21

    Chef: append to an exsting file from an "erb" template

  22. 22

    Run Powershell script from inside other Powershell script with dynamic redirection to file

  23. 23

    Run a .cmd file through PowerShell

  24. 24

    Run Registry File Remotely with PowerShell

  25. 25

    How to run chef without chef server (chef solo/chef zero)

  26. 26

    How to transform from erb file to my config file only in Chef?

  27. 27

    Powershell 'runspace' does not run from the Powershell console

  28. 28

    Run Powershell from C#

  29. 29

    run powershell command from cmd

HotTag

Archive