| I don't think this is a bug. If you have a corrupt executable that is in the PATH ahead of the real executable, then the OS will run the corrupt version. For example, the following
C:\Users\josh> echo '' > powershell.exe |
C:\Users\josh> set PATH=C:\Users\josh;%PATH% |
C:\Users\josh> powershell.exe --version
|
will generate an error message:
Unsupported 16-Bit Application - The program of feature '??\c:\Users\josh\powershell.exe' cannot start or run due to incompatibility with 64-bit versions of Windows...
Puppet's behavior is the same:
C:\Users\josh>bundle exec puppet apply -e "exec { 'C:/Users/josh/powershell.exe': }" |
Notice: Compiled catalog for localhost in environment production in 0.27 seconds |
/Stage[main]/Main/Exec[C:/Users/josh/powershell.exe]/returns: change from 'notrun' to ['0'] failed: This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher. - CreateProcess
|
Puppet should not try to second-guess the OS (such as skipping invalid entries in the PATH) as that could lead to security issues. |