We actually came across this exact issue and solved it by writing our own Mixlib to get the exit code from a powershell script. Example:
# get the result object (and exit code) from the code execution:
result = Mixlibrary::Core::Shell.windows_script_out(:powershell, mycode)
exit_status = result.exitstatus
@carpNick is planning on open-sourcing this perhaps as soon as this week....at the moment it only handles powershell, but we plan on implementing support for other types as well (bash, win modules, etc.) -- which should be fairly easy to add on support for others.
We are currently using it in-house and it works great. I'm sure Chef will want to review Nick's excellent code once he gets it out there. We are just waiting on legal to tell us what open-source license to use.
Ask Nick for more details... @carpnick | https://github.com/carpnick