The simple answer is, "you don't". What's the purpose or intention? Do you want additional logging? If so, that's where the log resource comes into play and may suggest areas where you are doing to many steps in one powershell resource or may be a good place to build a lightweight resource provider (LWRP).SteveSteven MurawskiCommunity Software Development Engineer @ ChefMicrosoft MVP - PowerShell
http://stevenmurawski.comOn 5/8/2015 3:37:26 AM, Simon Hawkins < " target="_blank"> > wrote:
All,
I have a bunch of write-host statements in a powershell block in a recipe.
When I run the script using powershell on the local machine, the write-host output writes the messages to the console.
When I run it via the chef-run it doesn’t:
[2015-05-08T09:30:48+01:00] INFO: powershell_script[rename_hostname] ran successfully
- execute "powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Unrestricted -InputFormat None -File
"C:/Users/ADMINI~1/AppData/Local/Temp/1/chef-script20150508-2840-aitigl.ps1"
[2015-05-08T09:30:48+01:00] INFO: Chef Run complete in 57.125115 seconds
How do I get the chef-run to write the write-host commands to the console on the run?
Cheers,
Simon.
Disclaimer
This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.
Totaljobs Group Limited Registered Office: Bluefin Building, 110 Southwark Street, London, SE1 0TA, UK Registered in England and Wales under company no. 4269861
Archive powered by MHonArc 2.6.16.