PowerShell / PowerShell Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CustomTableHeaderLabel formatting to differentiate table header labels that are not property names
#17346
base: master
Are you sure you want to change the base?
Conversation
src/System.Management.Automation/FormatAndOutput/common/PSStyle.cs
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
…ltiple lines and fix tests
CustomTableHeaderLabel formatting to differentiate table header labels that are not property names
CustomTableHeaderLabel formatting to differentiate table header labels that are not property namesCustomTableHeaderLabel formatting to differentiate table header labels that are not property names
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

PR Summary
Add
$PSStyle.Formatting.CustomTableHeaderLabelto enable differentiation inFormat-Tableoutput where a table header label isn't an actual property name. Usually these are either abbreviated, calculated, or has units added. Users can get confused because they expect it to be a property name and can't use dot-notation to access it. The default format is the same color as the table header but use italics.Since decoration is absolute and not relative (additive), to make this work correctly for each table header which IS a property member we need to wrap it with the normal decoration. This results in extra characters being emitted.
PR Context
Brought up in https://twitter.com/JustinWGrote/status/1524882725781377024
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.PSCustomTableHeaderLabelDecoration(which runs in a different PS Host).