GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add `-RepeatHeader` to `Format-Table` to enable repeating header for each screen full by SteveL-MSFT · Pull Request #8481 · PowerShell/PowerShell

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Dec 18, 2018 •
edited by daxian-dbw
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR Summary

When using a screen reader or just getting the output of a table with lots of rows, the header is no longer on the screen and the columns may no longer make sense without the context. This PR adds a -RepeatHeader switch to Format-Table to enable re-outputting the header after every screen full (minus 1 row). Expectation is that the user is piping the output to a pager (e.g. less) which uses the bottom row for pager information. I followed the AutoSize parameter as the way to get the parameter from the cmdlet into the deep formatting object where it's needed.

gifv

Fix #8455

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing add -RepeatHeader switch for Format-Table MicrosoftDocs/PowerShell-Docs#3443
      • Issue filed - Issue link:
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

daxian-dbw reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@SteveL-MSFT
support repeating header for each page of the table
822f400
@SteveL-MSFT Steve Lee (SteveL-MSFT) assigned Dongbo Wang (daxian-dbw) Dec 18, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from Paul Higinbotham (PaulHigin) and Travis Plunk (TravisEz13) December 18, 2018 01:13
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from Bruce Payette (BrucePay) and Dongbo Wang (daxian-dbw) as code owners December 18, 2018 01:13
@SteveL-MSFT Steve Lee (SteveL-MSFT) mentioned this pull request Dec 18, 2018
add -RepeatHeader switch for Format-Table MicrosoftDocs/PowerShell-Docs#3443
Merged
2 of 9 tasks
@SteveL-MSFT
fix codefactor issues
efe8124
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the format-table-header branch from 4b4f8b3 to efe8124 Compare December 18, 2018 01:57
@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Dec 18, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

The remaining codefactor issues are not related to this PR or I'm adopting the current conventions in the source code for consistency but breaks CodeFactor rules.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the format-table-header branch 2 times, most recently from 1073566 to 38c5f8e Compare December 18, 2018 05:47
@SteveL-MSFT
fix test issue since changing name of switch
3fc6463
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the format-table-header branch from 38c5f8e to 3fc6463 Compare December 18, 2018 06:41
PaulHigin
Paul Higinbotham (PaulHigin) suggested changes Dec 18, 2018
View reviewed changes
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@SteveL-MSFT
address Paul's feedback
9db85ca
daxian-dbw
Dongbo Wang (daxian-dbw) requested changes Dec 19, 2018
View reviewed changes
Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

PaulHigin
Paul Higinbotham (PaulHigin) approved these changes Dec 19, 2018
View reviewed changes
Steve Lee (SteveL-MSFT) and others added 3 commits December 19, 2018 10:50
@SteveL-MSFT
address Dongbo's feedback
eba3ada
@daxian-dbw
Propose a different way to organize the code
065f9e7
@SteveL-MSFT
Merge pull request #5 from daxian-dbw/format-table-header
2dd072a
Propose a different way to organize the code
daxian-dbw
Dongbo Wang (daxian-dbw) approved these changes Dec 19, 2018
View reviewed changes
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 110f78b into PowerShell:master Dec 20, 2018
@SteveL-MSFT Steve Lee (SteveL-MSFT) mentioned this pull request Dec 21, 2018
Fix mistake in formatting deserialization for repeatheader #8502
Merged
7 of 11 tasks
@iSazonov Ilya (iSazonov) added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Jan 17, 2019
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the format-table-header branch June 6, 2020 02:29
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@SteveL-MSFT @daxian-dbw
Add -RepeatHeader to Format-Table to enable repeating header for …
fc03034
…each screen full (PowerShell#8481)

When using a screen reader or just getting the output of a table with lots of rows, the header is no longer on the screen and the columns may no longer make sense without the context.  This change adds a `-RepeatHeader` switch to `Format-Table` to enable re-outputting the header after every screen full (minus 1 row).  Expectation is that the user is piping the output to a pager (e.g. less) which uses the bottom row for pager information.  I followed the `AutoSize` parameter as the way to get the parameter from the cmdlet into the deep formatting object where it's needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@daxian-dbw Dongbo Wang (daxian-dbw) daxian-dbw approved these changes
@TravisEz13 Travis Plunk (TravisEz13) Awaiting requested review from TravisEz13
@BrucePay Bruce Payette (BrucePay) Awaiting requested review from BrucePay
+1 more reviewer
@PaulHigin Paul Higinbotham (PaulHigin) PaulHigin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@daxian-dbw Dongbo Wang (daxian-dbw)

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Enable repeating table headers with Format-Table

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@SteveL-MSFT @daxian-dbw @PaulHigin @iSazonov
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.