The three Format cmdlets take pipeline input like the built-in Format-Table, Format-List and Format-Custom, which remain the right choice when output should go through PowerShell's formatting system. They write to the console like Write-Host, so $x = ... | Format-ConsoleTable captures nothing; -PassThru also writes the input objects to the pipeline, and -AsWidget returns the widget for Write-ConsoleWidget or Export-ConsoleFrame.
Name Kind Length Time Signed Path ---- ---- ------ ---- ------ ---- ConsoleMonster.2.0.0.nupkg NuGet 1482113 00:00:48.2000000 True C:\Support\GitHub\ConsoleMonste… ConsoleMonster.2.0.0.snupkg NuGet 402331 00:00:03.1000000 True C:\Support\GitHub\ConsoleMonste… ConsoleMonster-2.0.0.zip Module 2904576 00:00:11.7000000 True C:\Support\GitHub\ConsoleMonste… Docs.zip Module 51302 00:00:01.2000000 False C:\Support\GitHub\ConsoleMonste…
PSPublishModule artifacts ╭─────────────────────────────┬─────────┬──────────┬────────┬──────────────────────────────────────╮ │ Name │ Size │ Built in │ Signed │ Path │ ├─────────────────────────────┼─────────┼──────────┼────────┼──────────────────────────────────────┤ │ NuGet 2 │ │ ConsoleMonster.2.0.0.nupkg │ 1.41 MB │ 48 s │ ✓ yes │ C:\Support\GitHub\…nster.2.0.0.nupkg │ │ ConsoleMonster.2.0.0.snupkg │ 393 KB │ 3.1 s │ ✓ yes │ C:\Support\GitHub\…ster.2.0.0.snupkg │ │ Subtotal │ 1.8 MB │ 51 s │ │ │ │ Module 2 │ │ ConsoleMonster-2.0.0.zip │ 2.77 MB │ 12 s │ ✓ yes │ C:\Support\GitHub\…Monster-2.0.0.zip │ │ Docs.zip │ 50.1 KB │ 1.2 s │ – no │ C:\Support\GitHub\…s\Packed\Docs.zip │ │ Subtotal │ 2.82 MB │ 13 s │ │ │ ├─────────────────────────────┼─────────┼──────────┼────────┼──────────────────────────────────────┤ │ Total │ 4.62 MB │ 1 m 04 s │ │ │ ╰─────────────────────────────┴─────────┴──────────┴────────┴──────────────────────────────────────╯
-Property
- Names, wildcards and calculated properties work as in Format-Table.
- A hashtable with column options configures that column:
Name(orExpression),Header,Key,Priority,MinWidth,MaxWidth,Width,Overflow(Wrap,Truncate,TruncateMiddle,Never),MaxLines,Alignment,Presenter,Unit,Aggregate,Highlight,Markupand thresholds such asWarnAboveandFailBelow. - Without
-Property, an object's DefaultDisplayPropertySet is used.
Get-ChildItem C:\Windows\Logs -Recurse -File | Format-ConsoleTable -GroupBy Extension -Total -Top 20 -Property @(
@{ Name = 'Name'; Key = $true }
@{ Name = 'Length'; Header = 'Size'; Presenter = 'Bytes'; Priority = 9 }
@{ Name = 'LastWriteTime'; Header = 'Changed'; Presenter = 'DateRelative'; Priority = 5 }
@{ Name = 'FullName'; Header = 'Path'; Overflow = 'TruncateMiddle'; Priority = 1 }
)
Other parameters
| Parameter | What it does |
|---|---|
-GroupBy | Groups rows, with subtotals when -Total is set. |
-Total | A totals row (sum, count, average, minimum or maximum per column). |
-Top N | Only the first N rows. |
-Width | Lays the table out for a given width instead of the console's. |
-Culture | Numbers and dates in a given culture; by default the current culture, as Format-Table does. |
-Title, -Caption, -Border | The table's frame. |
When the console is narrow
Columns hide by priority and a footer names them; below 60 cells, when the minimum widths still do not fit, rows turn into cards titled with the key value. A single object renders as a record view.
PSPublishModule artifacts · 4 recordsNuGet ConsoleMonster.2.0.0.nupkg Size 1.41 MB Built in 48 s Signed ✓ yes Path C:\Support\GitHub\ConsoleMonster
Artefacts\Packed
ConsoleMonster.2.0.0.nupkg ConsoleMonster.2.0.0.snupkg Size 393 KB Built in 3.1 s Signed ✓ yes Path C:\Support\GitHub\ConsoleMonster
Artefacts\Packed
ConsoleMonster.2.0.0.snupkgModule ConsoleMonster-2.0.0.zip Size 2.77 MB Built in 12 s Signed ✓ yes Path C:\Support\GitHub\ConsoleMonster
Artefacts\Packed\ConsoleMonster-2.0.0.zip Docs.zip Size 50.1 KB Built in 1.2 s Signed – no Path C:\Support\GitHub\ConsoleMonster
Artefacts\Packed\Docs.zipTotal Size 4.62 MB Built in 1 m 04 s
The tables page shows each behaviour at six widths, and the PowerShell page compares Format-List with Format-ConsoleList.