For example in this simple cookbook recipe:
batch "Clear_OS_Agent" do
code <<-EOH
@echo on
dir C:\
@echo off
EOH
action :run
When I run chef-client.bat
on a Windows node, I can get the result of dir C:\
But when I redirect in into a file chef-client.bat > C:\chef_log.txt
, there are only the general chef-client.bat
output over there, without the result of dir C:\
.