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 — [release/v7.6.7] Allow user to force the default implicit formatting to use `AutoSize` by daxian-dbw · Pull Request #28096 · PowerShell/PowerShell

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Sep 24, 2026

Copy link
Copy Markdown
Member

Backport of #28018 to release/v7.6.7

Triggered by Dongbo Wang (@daxian-dbw) on behalf of Dongbo Wang (@daxian-dbw)

Original CL Label: CL-General

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Customer Impact

  • Customer reported
  • Found internally

Adds a new $PSStyle.AutoSizeDefaultFormatting setting. When set to $true, PowerShell's default implicit formatting (via Out-Default) will enforce AutoSize for table/wide views, matching Format-Table -AutoSize/Format-Wide -AutoSize behavior. This lets users get less verbose, better-fitting output in small terminal windows or when consumed by an agent, without needing to explicitly pipe to Format-Table/Format-Wide.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Original PR added a test verifying that List and Complex view formatting remain streamed (not buffered) even with AutoSizeDefaultFormatting enabled. Backport verified by confirming the cherry-pick applied cleanly with no conflicts on release/v7.6.7.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk: adds new opt-in formatting behavior gated behind a new $PSStyle property that defaults to off, so existing behavior is unchanged unless a user explicitly opts in. List and Complex views remain streamed (unbuffered), limiting the scope of the change.

Sorry, something went wrong.

Uh oh!

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

kborowinski reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@daxian-dbw
Allow user to force the default implicit formatting to use AutoSize (…
1411f6b
…PowerShell#28018)

When `$PSStyle.AutoSizeDefaultFormatting = $true`, the default implicit formatting applied by PowerShell (via `Out-Default`) will enforce `AutoSize` when the chosen formatting view is `table` or `wide`, similar to running `Format-Table -AutoSize` and `Format-Wide -AutoSize` explicitly. The `List` and `Complex` views formatting won't be buffered though -- they will continue to be streamed.

This allows PowerShell to generate less verbose output when used by an agent. It also makes PowerShell works better with small-window terminal.
Copilot AI lite review requested due to automatic review settings September 24, 2026 21:28
@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 24, 2026
@azure-pipelines

azure-pipelines Bot commented Sep 24, 2026

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
All reactions

Sorry, something went wrong.

Uh oh!

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

Copilot started reviewing on behalf of Dongbo Wang (daxian-dbw) September 24, 2026 21:29
View session
Copilot AI reviewed Sep 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The fallback path drops formatting parameters, preventing AutoSize for objects without registered format views.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
  • Medium severity Preserve autosize parameter when falling back without a default view · New
What changed in this PR

Backports opt-in $PSStyle.AutoSizeDefaultFormatting support for implicit table and wide formatting while preserving streaming for list and complex views.

Changes:

  • Adds the new PSStyle setting and default display property.
  • Applies AutoSize during default formatting.
  • Adds formatting and streaming tests.
File Summary
test/​powershell/​engine/​Formatting/​PSStyle.Tests.ps1 Tests the new setting and formatting behavior.
src/​System.Management.Automation/​FormatAndOutput/​format-default/​format-default.cs Applies the AutoSize override; the fallback path requires correction.
src/​System.Management.Automation/​FormatAndOutput/​DefaultFormatters/​PowerShellCore_format_ps1xml.cs Displays the new PSStyle property.
src/​System.Management.Automation/​FormatAndOutput/​common/​PSStyle.cs Defines the new setting.
src/​System.Management.Automation/​FormatAndOutput/​common/​FormatViewGenerator.cs Restricts AutoSize to table and wide views.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs Resolved

Uh oh!

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

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Sep 24, 2026
View reviewed changes
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 4bb1dc6 into PowerShell:release/v7.6.7 Sep 24, 2026
36 checks passed

Uh oh!

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

@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the backport/release/v7.6.7/28018-2179219c8 branch September 24, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@daxian-dbw @adityapatwardhan
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.