Powershell scripts running on Windows Server 2019 are not returning the right error code in the Sensu UI. The powershell exit code is exit 2, but the sensu UI is seeing it as a warning, exit code 1. I am running Sensu-go binary 6.1.3 on the backends as well as the agents. It is all powershell scripts doing the same thing. There is nothing in logs to say why this is happening, I have tried to change different error codes, and it always returns with either 1 or 0. I cannot get it to return a critical.
Any advice on how I can troubleshoot/fix this?