Powershell shows failed, application installs

I have a script to uninstall an application before installing the newer version. The process works smoothly, but the pop up notification in the systray shows that the installation fails. What triggers a success or failure? Is it from SCCM detection?

What does the installation log under C:\Windows\Logs\Software say is the exit code? If this is a ConfigMgr Application, I would double check that the detection method is valid.

I looked at the installation log, and execution failed with code: 129 which is a Success (No Reboot) in SCCM, but I think in SAP that means the workstation has pending reboots. I’m not sure why it is still showing “Failed”. Thoughts?

Use -IgnoreExitCodes “129” for Execute-Process. If the exit code isn’t 0 or 3010, it is considered a failure.