I have a situation where it’s possible this package may run multiple times and I would like PSADT to ignore any errors, including if the path doesn’t exist. With the command below, the script is existing with code 60002 or 60001.
- The log state the path is valid, which it is not.
- I’m OK with using Test-Path before the command, but just wondering is I’m missing something.
Execute-Process -Path "$envWINDIR\CCMSetup\CCMSetup.exe" -Parameters "/Uninstall" -ContinueOnError $true
[Pre-Installation] :: [C:\WINDOWS\CCMSetup\CCMSetup.exe] is a valid fully qualified path, continue.
[Pre-Installation] :: Function failed, setting exit code to .
Message : File [C:\WINDOWS\CCMSetup\CCMSetup.exe] not found.
FullyQualifiedErrorId : File [C:\WINDOWS\CCMSetup\CCMSetup.exe] not found.
+ Throw <<<< “File [$Path] not found.”
[Pre-Installation] :: Close the installation progress dialog.