Closed joekiller closed 8 years ago
Oh and this only affects windows. I'm running in powershell.
Try using 2 carets. The knife commands are .bat files that spawn ruby. The bat file is run in CMD.exe where the caret is special. 2 carets should escape the second.
Thanks for the tip. I ended up having to use 4 caret's per caret I wanted. Details here: http://stackoverflow.com/questions/5254460/how-can-i-get-a-password-containing-a-caret-passed-unchanged-as-a-parameter
Solution: Unquoted, use 4 consecutive carets (ex: use pass^^^^word to produce pass^word) Solution: Quoted, use 2 consecutive carets (ex: use "pass^^word" to produce pass^word)
my oh my!
I'm trying to do stuff like
knife winrm HOST chef-client -m -x 'user' -P 'pass^word' -VV
.I end up seeing:
If I leave the password toggle out and rely on
So it seems like https://github.com/chef/knife-windows/blob/9e0494f35d284eee5d3725e0c237b88ecddaecdc/lib/chef/knife/winrm_base.rb#L52 is stripping the ^
because https://github.com/chef/knife-windows/blob/14c6b9bda654dc4fda2fa9f03a7e26bc9b926297/lib/chef/knife/winrm_knife_base.rb#L274 works.