I have no explanation why Jenkins jobs do not react to PowerShell error as described in the docs: https://www.jenkins.io/blog/2017/07/26/powershell-pipeline/
Either try -ErrorAction Stop
after each command (Everything you wanted to know about exceptions)
Or set $ErrorActionPreference = 'Stop'
at the beginning
Example
try {
powershell """
throw new Exception("ERROR: This is a test Exception.") -ErrorAction Stop
"""
}