I have a bat file that calls chef-client (as well as other things). When I redirect the output of my batch file to a file, it doesn't print the output of chef-client, but I can't understand why.
For example, I have test.bat with only this line (I've simplified it to this to isolate the problem, but in reality has more)
call chef-client %*
This prints
Starting Chef Client, version 12.13.37
followed by rest of output
Doing this
test.bat > test.log 2>&1
prints nothing to test.log (it creates an empty file)
If I even take the contents of chef-client.bat and call it directly, I see the same results:
C:\opscode\chef\embedded\bin\ruby.exe C:\opscode\chef\bin\chef-client remoteapp::default > C:\test.log 2>&1
prints nothing to test.log
but removing the redirection prints
Starting Chef Client, version 12.13.37
as I would expect. How can I get redirection to file working here?