Skip to content
ConsoleMonster
Cmdlet

Format-ConsoleTable

Module ConsoleMonster
Inputs
System.Management.Automation.PSObject

Formats pipeline objects as a width-aware table and writes it to the host.

Syntax

Format-ConsoleTable [-AsWidget] [-Border <Rounded|Square|Double|Minimal>] [-Caption <Object>] [-CardsBelow <Int32>] [-Culture <CultureInfo>] [-GroupBy <Object>] [-InputObject <PSObject>] [-NoHeaderSeparator] [-PassThru] [[-Property] <Object[]>] [-Title <Object>] [-Top <Int32>] [-Total] [-Width <Int32>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Formats pipeline objects as a width-aware table and writes it to the host.

Columns come from -Property (like Format-Table: names, wildcards and calculated properties @{ Name; Expression }), from the type's DefaultDisplayPropertySet, or from the objects' properties. Column options go in the same hashtables: Overflow (Wrap, Truncate, TruncateMiddle, Never), MaxLines, Priority, Key, MinWidth, MaxWidth, Width, Alignment, Presenter (Text, Status, Number, Bytes, Duration, Date, DateRelative, DateBoth, Boolean, Bar, Sparkline, Progress, Link), Unit, Aggregate, Header and tone rules (FailAbove, WarnAbove, FailBelow, WarnBelow, PassAbove, PassBelow, Tone). When the table is too wide, low-priority columns hide with a footer that names them; below -CardsBelow cells the rows become record cards; a single object becomes a record view. Redirected output is plain text without escape codes.

Examples

Authored help example

EXAMPLE 1

Format-ConsoleTable -AsWidget

Parameters

-AsWidget SwitchParameter optional
Writes the table widget to the pipeline instead of drawing it (for Export-ConsoleFrame, New-ConsolePanel or a dashboard).
-Border TableBorder optional
Border style: Rounded, Square, Double, Minimal or None.
Possible values: Rounded, Square, Double, Minimal
-Caption Object optional
A caption below the table (markup, muted).
-CardsBelow Int32 optional
Below this width (in cells) rows become record cards when the grid cannot fit; 0 disables cards. Default 60.
-Culture CultureInfo optional
The culture for numbers and dates, for example en-US or pl-PL (labels stay English). Defaults to CONSOLEMONSTER_CULTURE, then the current culture, as PowerShell's own formatting does.
-GroupBy Object optional
Groups rows under headings by a property name or a scriptblock; with -Total each group gets a subtotal.
-InputObject PSObject optionalpipeline: True (ByValue)
The objects to show (pipeline input).
-NoHeaderSeparator SwitchParameter optional
Underlines the header instead of drawing a separator row.
-PassThru SwitchParameter optional
Also writes the input objects to the pipeline.
-Property Object[] optionalposition: 0
Properties (names, wildcards, calculated properties and column option hashtables).
-Title Object optional
A title above the table (markup).
-Top Int32 optional
Shows only the first N rows followed by "Showing N of M" (totals still cover every row).
-Total SwitchParameter optional
Adds a totals row; numeric columns without an Aggregate option are summed.
-Width Int32 optional
Lays the table out for this width instead of the terminal's (for files, logs and previews).

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.