I tried to track down the root cause of this but was unable to in the time I had available.
In cmd.exe, running this echo %^COMPUTERNAME% outputs %COMPUTERNAME%
In mixlib/shellout, running
blah = Mixlib::ShellOut.new("echo %^COMPUTERNAME%")
blah.run_command.stdout
outputs %^COMPUTERNAME%. I would expect the carat to be removed like it is in cmd.exe.
The end result of this behavior is that I can't run commands that expected unexpanded environment variables as arguments.