Created
December 26, 2017 19:32
-
-
Save poshcodebear/32374430ae2459ece96cd8136b26ac0d to your computer and use it in GitHub Desktop.
Error Examples
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
# throws an error: | |
Get-Content nothing | |
# Should show the same error message: | |
$Error[0] | |
# Shows the target of your command: | |
$Error[0].TargetObject | |
# Shows the message itself (the first line in the error on your screen): | |
$Error[0].Exception.Message | |
# Shows the exact command you used: | |
$Error[0].InvocationInfo.Line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment