FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add OutputType to `Get-Error` cmdlet and preserve original typenames by SteveL-MSFT · Pull Request #10856 · PowerShell/PowerShell · GitHub

Add OutputType to Get-Error cmdlet and preserve original typenames - #10856

Merged
Ilya (iSazonov) merged 7 commits into
PowerShell:masterfrom
SteveL-MSFT:geterror-outputtype
Nov 19, 2019
Merged

Add OutputType to Get-Error cmdlet and preserve original typenames#10856
Ilya (iSazonov) merged 7 commits into
PowerShell:masterfrom
SteveL-MSFT:geterror-outputtype

Conversation

Steve Lee (SteveL-MSFT) commented Oct 21, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Cmdlet was missing declaring OutputType which is ErrorRecord#PSExtendedError and Exception#PSExtendedError. 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.

PR Checklist

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry windows

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Windows

get-error outputtype is errorrecord and exception
fix formatting that wasn't handling parse exceptions correctly
update tests to check typenames
Steve Lee (SteveL-MSFT) changed the title Add OutputType to Get-Error cmdlet Add OutputType to Get-Error cmdlet and preserve original typenames Oct 22, 2019

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry static

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-static-analysis

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think you have a typo in there

ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 22, 2019
ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 23, 2019
Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 30, 2019

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Do you want to get approve from anybody?

Copy link
Copy Markdown
Member Author

James Truher (@JamesWTruher) can you review?

Copy link
Copy Markdown
Collaborator

Up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

just a couple questions

Ilya (iSazonov) merged commit 9b71696 into PowerShell:master Nov 19, 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.

Copy link
Copy Markdown

🎉v7.0.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

Steve Lee (SteveL-MSFT) deleted the geterror-outputtype branch June 6, 2020 02:30
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/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

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL