Repository navigation
Add OutputType to Get-Error cmdlet and preserve original typenames - #10856
Merged
Ilya (iSazonov) merged 7 commits intoNov 19, 2019
Merged
Conversation
10 of 14 tasks
Member
Author
|
PoshChan-Bot (@PoshChan) please retry windows |
Collaborator
|
Steve Lee (@SteveL-MSFT), successfully started retry of |
get-error outputtype is errorrecord and exception fix formatting that wasn't handling parse exceptions correctly update tests to check typenames
Get-Error cmdletGet-Error cmdlet and preserve original typenames
Member
Author
|
PoshChan-Bot (@PoshChan) please retry static |
Collaborator
|
Steve Lee (@SteveL-MSFT), successfully started retry of |
James Truher (JamesWTruher)
suggested changes
Oct 22, 2019
James Truher (JamesWTruher)
left a comment
Collaborator
There was a problem hiding this comment.
I think you have a typo in there
Ilya (iSazonov)
approved these changes
Oct 30, 2019
Collaborator
|
Steve Lee (@SteveL-MSFT) Do you want to get approve from anybody? |
Member
Author
|
James Truher (@JamesWTruher) can you review? |
Collaborator
|
Up. |
James Truher (JamesWTruher)
left a comment
Collaborator
There was a problem hiding this comment.
just a couple questions
James Truher (JamesWTruher)
approved these changes
Nov 18, 2019
Travis Plunk (TravisEz13)
pushed a commit
that referenced
this pull request
Dec 4, 2019
…10856) - Added OutputType attribute. - Cmdlet adds the PSExtendedError typename and removes Exception and ErrorRecord typenames so that the formatting is used. The formatter then removes PSExtendedError and puts back the original typename so that $Error should be the same before calling Get-Error. - While testing, had to make some changes to how InvocationInfo is retrieved so that ParseException which contains a nested ErrorRecord which as InvocationInfo is handled correctly. - Combined Exception and ErrorRecord formatter into one.
|
🎉 Handy links: |
22 tasks
Thatgfsj (Thatgfsj)
pushed a commit
to Thatgfsj-contribs/PowerShell
that referenced
this pull request
Aug 6, 2026
…owerShell#10856) - Added OutputType attribute. - Cmdlet adds the PSExtendedError typename and removes Exception and ErrorRecord typenames so that the formatting is used. The formatter then removes PSExtendedError and puts back the original typename so that $Error should be the same before calling Get-Error. - While testing, had to make some changes to how InvocationInfo is retrieved so that ParseException which contains a nested ErrorRecord which as InvocationInfo is handled correctly. - Combined Exception and ErrorRecord formatter into one.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Cmdlet was missing declaring OutputType which is
ErrorRecord#PSExtendedErrorandException#PSExtendedError. Added OutputType attribute. Cmdlet adds thePSExtendedErrortypename and removesExceptionandErrorRecordtypenames so that the formatting is used. The formatter then removesPSExtendedErrorand puts back the original typename so that$Errorshould be the same before callingGet-Error. While testing, had to make some changes to how InvocationInfo is retrieved so that ParseException which contains a nested ErrorRecord which as InvocationInfo is handled correctly. Combined Exception and ErrorRecord formatter into one.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.