Skip to content
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

Format-Table ignores custom columns widths except in the first column #14676

Closed
mklement0 opened this issue Jan 28, 2021 · 7 comments
Closed
Labels
Needs-Investigation The behavior reported in the issue is unexpected and needs further investigation. Resolution-No Activity Issue has had no activity for 6 months or more WG-Engine-Format

Comments

@mklement0
Copy link
Contributor

mklement0 commented Jan 28, 2021

Related: #14677

Note: This bug affects Windows PowerShell too.

Steps to reproduce

$obj = [pscustomobject] @{ a='A'; b='1234567890'; c='C' }

# OK - custom width is in the *first* column.
$obj | Format-Table -Property @{ e='b'; width = 5 }, c | Out-String | Should -Match '1234…'

# !! BROKEN: custom width is (only) in a column *other* than the first:
$obj | Format-Table -Property a, @{ e='b'; width = 5 }, c | Out-String | Should -Match '1234…'

Expected behavior

Both tests should succeed.

Actual behavior

The 2nd test fails, because the custom column width was unexpectedly not applied.

Expected regular expression '1234…' to match ' a b          c - -          - A 1234567890 C  ', but it did not match.

Note that, similarly, custom widths in later columns only take effect if one was specified for and successfully applied to the first column.

Environment data

PowerShell Core 7.2.0-preview.2
@mklement0 mklement0 added the Needs-Triage The issue is new and needs to be triaged by a work group. label Jan 28, 2021
@daxian-dbw daxian-dbw added Issue-Bug Issue has been identified as a bug in the product WG-Engine-Format Needs-Investigation The behavior reported in the issue is unexpected and needs further investigation. and removed Needs-Triage The issue is new and needs to be triaged by a work group. Issue-Bug Issue has been identified as a bug in the product labels Jan 28, 2021
@zett42

This comment has been minimized.

@mklement0 mklement0 changed the title Formate-Table ignores custom columns widths except in the first column Format-Table ignores custom columns widths except in the first column Jan 28, 2021
@mklement0

This comment has been minimized.

@mklement0

This comment has been minimized.

Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

2 similar comments
Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

Copy link
Contributor

This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-No Activity Issue has had no activity for 6 months or more labels Nov 16, 2023
Copy link
Contributor

This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Investigation The behavior reported in the issue is unexpected and needs further investigation. Resolution-No Activity Issue has had no activity for 6 months or more WG-Engine-Format
Projects
None yet
Development

No branches or pull requests

3 participants