Problem Definition
When powershell is not available the following error can be seen in the build logs:
Failing task since return code of [powershell -ExecutionPolicy bypass -Command C:\Users\xxx\AppData\Local\Temp\56328195-56426502-55312562-ScriptBuildTask-4818059119502732407.ps1] was -1 while expected 0
This error is not helpful to diagnose that poswershell is not available in the agent.
Suggested Solution
Treat this error to show what is actually happening. The command is not available.