opscode/knife-windows — pull request #98 by carpnick (2014-09-25 02:25:47+00:00)
Title: Get knife winrm command to return the exit code that is returned by the ...

...remote command if it is not expected.

Basically lets say we need to exit mid chef run for some reason - need to do a reboot. We might have a continuous delivery system that is monitoring exit codes of knife commands to determine what to do next. Use case here is our cookbook code could signal our delivery system with exit codes of, for example, rebooting. This will allow us to pause and wait for the winrm port to be open again, before we reinitiate a winrm command.

Relevant lines from SSH (I believe -did a quick look):
https://github.com/opscode/chef/blob/master/lib/chef/knife/ssh.rb#L524-L526