Hello,
I would like to add some logging into my powershell_script section of my recipe. write-host doesn’t work, what is the best method for writing information to the chef log file?
Hello,
I would like to add some logging into my powershell_script section of my recipe. write-host doesn’t work, what is the best method for writing information to the chef log file?
Pipe to Out-file ?
Because you are in a powershell session, you dont have access to amy of the recipie DSL methods. While using out-file
or another powershll accesible file writing technique to write to the chef log may work, that is also wrought with file locking danger. Some other possibilities include:
You could also use powershell_out
in a custom resource if you need to get the output from the command to do something with.