I have the following script,
$createZip = { Param ([String]$source, [String]$zipfile) Process { echo \"zip: $source`n --> $zipfile\"
TLDR:
# Works with both terminating and non terminating errors $j = start-job {1/0} | wait-job; try { rcjb $j -ErrorAction Stop } catch { "err $_" }