Running this script manually works without any issue but on certain machines it fails with a $Path error. The odd thing is it only happened on 5 out of 16 machines; 11 machines ran successfully.
What version of the toolkit are you using? It looks like the toolkit failed to find the fully qualified path to msiexec.exe in function Execute-Process. The code that does this is at the very start of the function. I would suggest copying this portion of the code out of the function and testing it by itself on the PC generating the error to see if you can identify what the problem might be.
I would also suggest changing the -ErrorAction behaviour for this line to ‘Stop’ instead of ‘SilentlyContinue’. That might show us details for some error that may be getting suppressed:
This script started off using 3.6.3 once I ran into this issue I created it again using 3.6.4 to see if the issue followed. So right now I am using 3.6.4. I did as you suggested and it looks like it is an msiexec issue
I am trying to find one of the failing machines to see what I can figure out. Last night I remoted to one of the failed machines and when deploy-application.exe was ran locally it ran successfully.
[Installation] :: Function failed, setting exit code to [60002].
Error Record:
Message : The term ‘msiexec.exe’ is not recognized as the name of a cmdl
et, function, script file, or operable program. Check the spel
ling of the name, or if a path was included, verify that the p
ath is correct and try again.
InnerException :
The line where your error is occuring uses the Get-Command cmdlet to search the Path environment variable ($env:path) to find the fully qualified path of a file when a fully qualified path is not provided. Check the path environment variable on machines throwing an error to see if it is configured properly.
Turns out even though they looked ok the registry entry was a REG_SZ entry instead of a REG_EXPAND_SZ somehow. I fixed that reboot and pushed the install again and it succeeded like normal.
Thanks for helping me look down the right path (no pun intended) Muhammad!