I'm new to powershell and troubleshooting an issue with one of our custom cmdlets. By default, all exceptions thrown within the cmdlet have minimum information, no stack trace and no info on chained exceptions. Is there a way to enable verbose output of exceptions?
the $error collection contains a live list of all unhandled exceptions thrown in the current session. The last exception is at $error[0]. A good technique to do something like this to capture the error as soon as possible:
ps> invoke-something
error: ...
ps> $e = $error[0]
Explore $e with get-member.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With