I need to uninstall an exe file before the main installation.
When I am running the command: Execute-Process -path "C:\Guideline\unins000.exe" -parameters '/VERYSILENT'
I am getting an error message: Message : Function failed, setting exit code to [60002]. File [C:\Guideline\unins000.exe] not found.
Seems that the file is not always present in all workstations.
Is there is a way to add a parameter to that command to continue the script even though the file is not present?
If you don’t want to verify if the file exists before you run it as GorgoMoondust suggested you can use one of the following parameters to the Execute-Process function: -ContinueOnError $true -IgnoreExitCodes ‘60002’