Runing such script:
1: function foo() 2: { 3: bar 4: } 5: 6: function bar() 7: { 8: throw \"test\" 9: } 10: 11: foo
I see
I just figured it out. The $_ is the exception caught in the catch block.
$errorString= $_ | Out-String