Skip to content

Highlight using error color the exception Message and underline in PositionMessage for Get-Error - #15786

Merged
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:color-detailed
Jul 16, 2021
Merged

Highlight using error color the exception Message and underline in PositionMessage for Get-Error#15786
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:color-detailed

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Jul 15, 2021

Copy link
Copy Markdown
Member

PR Summary

Suggested on the Community Call by Keith Hill (@rkeithhill) to help make important parts of the detailed output of Get-Error to highlight the Exception/ErrorRecord Message as well as the underline for where the error occurred in the PositionMessage member. The change will use the $PSStyle.Formatting.Error color to highlight any property called Message and the ~~~ underline used in a property called PositionMessage. This means that some members may be highlighted unintentionally, but it seems those would be corner cases.

Example:
image

PR Context

Fix #15783

PR Checklist

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jul 16, 2021
Comment thread test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 Outdated
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Reassigning since Andrew is taking time off right now

@iSazonov
Ilya (iSazonov) merged commit 9fb3c2e into PowerShell:master Jul 16, 2021
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.8 milestone Jul 16, 2021
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the color-detailed branch July 18, 2021 20:53
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.8 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
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.

New DetailedView could use some extra color highlighting from ConciseView

3 participants