How do folks handle errors inside a PowerShell Task. It seems like the task will *always* succeed.
Things I've tried.
1. throw
2. $PSCmdlet.ThrowTerminatingError
3. $ErrorActionPreference = 'Stop'
4. Write-Error
The only thing I can think to do is set up a Script Task to inspect the Results variable. The problem there is that the output is PSDataCollection<PSObject> and a Script task doesn't natively support the System.Management.Automation library. One would have to manually add the dll.
So the task appears to be worth *ALOT* less than originally thought.