Execute-Process with -MsiExecWaitTime

I’m trying to get a .msi to install using Execute-Process so I can take advantage of -MsiExexWaitTime. Here is my code:
Execute-Process -Path “C:\Windows\system32\msiexec.exe /i $dirSupportFiles’ITCleanupUtility-4-RussellReynold.msi’” -Parameters “/quiet” -MsiExecWaitTime 400 -IgnoreExitCodes *

However, when it runs, this is what I get in the log:
[Pre-Installation] :: File [C:\Windows\system32\msiexec.exe /i C:\TEMP\ObserveIT\7.11\PSADT\SupportFiles’ITCleanupUtility-4-RussellReynold.msi’] not found.

It is set to run during Pre-Installation. I .msi file is present. I have tried it with the .msi between ’ ’ and withouth the ’ '. But I still get the “not found” error.

I would appreciate any help.

Thanks.

Try this instead:

Execute-Process -Path "C:\Windows\system32\msiexec.exe"  -Parameters "/i `"$dirSupportFiles\ITCleanupUtility-4-RussellReynold.msi`" /quiet" -MsiExecWaitTime 400 -IgnoreExitCodes *

Remember: You are passing parameters to msiexec.exe, not the MSI.

1 Like