Closed mikkoc closed 7 years ago
@mikkoc I'm not able to repro. Is this a stock image, or has it been customized before running this command? One possibility is that cmd.exe command extensions to support "!" syntax aren't enabled for some reason. Do you have any configuration of that nature in place?
Also, @mikkoc, does this reproduce for you using release 0.8.6?
This does not seem to be a regression, I can repro a very similar failure with 0.8.6 if I set the following in the user profile of the user under which the bootstrap is running on the Windows node:
`HKCU\Software\Microsoft\Command Processor' 'EnableExtensions' to "0"
If I then set this value to 1, everything is fine. To work around the issue you're hitting, set this to back to "1" and see if it fixes things.
I've also validated that we can fix this if it is indeed your issue by forcing cmd.exe to run with cmd extensions enabled at the command line, so that's a fix we'll deliver soon.
@adamedx I switched back to 0.8.6 with validator key and the problem is fixed so I'm not sure what caused the issue in the first place. We are using custom Windows images, yes.
@mikkoc, I would say the custom image at least explains why we're not seeing it elsewhere. What if you use 1.0 with a validator -- does it still happen then?
We'd like to get this working for you, but since we can't repro here, it would help if you can try a few things out:
HKCU\Software\Microsoft\Command Processor'
, 'EnableExtensions', HKLM\Software\Microsoft\Command Processor' 'EnableExtensions'
, HKEY_USERS\.default\Software\Microsoft\Command Processor' 'EnableExtensions'
is set to anything other than 1
?I'm happy to say that I cannot reproduce it anymore, even with 1.0.0 and validator/validatorless setup! I checked those registry entries and they're all set to '1'. Feel free to close this issue. I think it got messed up when I copied the knife-windows-1.0.0.rc2 directory into the chefDK embedded gems directory, replacing the one that came with chefDK.
Thank you for the response @mikkoc. Now that is very mysterious. :) Yes, copying the gem over could have caused some strange issues actually. I'm going to keep this open a little while longer because you did actually expose an issue where we can't bootstrap systems with command extensions disabled. That's unlikely to ever be set of course, but we might as well protect against it. So we'll close once we merge that fix.
@mikkoc, thank you for testing out the RC for 1.0 -- glad you're getting some use out of the new features!
Hello, I am also getting same issue on 2008R2 can you help me to resolve issue?
Thanks
@cpkatragadda that issue is actually a different one entirely - as the node doesn't seem to have powershell.exe in the path or installed which will present a huge problem if trying to use knife-winrm. Given the age and the fact the originally reported issue was resolved I'm closing this one out but feel free to open a new one if still having trouble
Hello, using knife-windows 1.0.0.rc2 with validatorless setup.
Running into this issue:
I nailed it down to this snippet of code:
In particular the last line fails to execute with:
Executing the command directly works:
Using Powershell 4.0: