Created
June 14, 2018 14:37
-
-
Save vexx32/52810ecba149dfef0045ac4ffd460af2 to your computer and use it in GitHub Desktop.
Traverse exception stack for all inner exceptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Exception = $_ | |
$ExceptionStack = @{ | |
OuterException = $_ | |
} | |
$Increment = 0 | |
while ($Exception.InnerException) { | |
$Increment++ | |
$Exception = $Exception.InnerException | |
$ExceptionStack["InnerException$Increment"] = $Exception | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment