NOTE: This seems to only affect Win10 1809 LTSC and/or PowerShell 5.1.17763.1
I've got this demo-script, which I put into a Jenkins job:
Write-Host "##############################################"
$ErrorActionPreference = "Stop"
Write-Host "ErrorActionPreference: $ErrorActionPreference"
Write-Host "whoami: $(whoami)"
$PSVersionTable | Format-Table