Skip to content
ConsoleMonster

ConsoleMonster in PowerShell

84 cmdlets with a plain Console noun, in one binary module for Windows PowerShell 5.1 and PowerShell 7. Every frame on this page was captured from both hosts running the script beside it.

Format-ConsoleTable PowerShell 7.624-bit
 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 │        │                                      │
╰─────────────────────────────┴─────────┴──────────┴────────┴──────────────────────────────────────╯

Format-ConsoleTable beside Format-Table

The same four objects, formatted by the built-in cmdlet and by ConsoleMonster in a 100-column console. Format-ConsoleTable takes pipeline input and -Property as Format-Table does: names, wildcards and calculated properties, plus hashtables with column options.

Format-Table

Format-Table -AutoSize PowerShell 7.6
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…

Format-ConsoleTable

Format-ConsoleTable PowerShell 7.6
 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 │        │                                      │
╰─────────────────────────────┴─────────┴──────────┴────────┴──────────────────────────────────────╯
PowerShellformat-table.ps1
. .\artifacts.ps1
$artifacts | Format-Table -AutoSize
PowerShellformat-consoletable.ps1
. .\artifacts.ps1
$artifacts | Format-ConsoleTable -Title '[bold]PSPublishModule[/] [muted]artifacts[/]' -GroupBy Kind -Total -Property @(
    @{ Name = 'Name'; Key = $true; Overflow = 'Never' }
    @{ Name = 'Length'; Header = 'Size'; Presenter = 'Bytes'; Priority = 9; Aggregate = 'Sum' }
    @{ Name = 'Time'; Header = 'Built in'; Presenter = 'Duration'; Priority = 6; Aggregate = 'Sum' }
    @{ Name = 'Signed'; Presenter = 'Boolean'; Priority = 5 }
    @{ Name = 'Path'; Overflow = 'TruncateMiddle'; Priority = 1; MinWidth = 20 }
)
  • -GroupBy, -Total, -Top, -Width and -Culture
  • Presenters for bytes, durations, dates, booleans and status
  • Without -Property, an object's DefaultDisplayPropertySet is used
  • Redirected output is plain text; -PassThru also writes the input objects
The data both scripts use
PowerShellartifacts.ps1
# Shared data for the PowerShell page: build artifacts as PSPublishModule reports them.
$artifacts = @(
    [pscustomobject] @{ Name = 'ConsoleMonster.2.0.0.nupkg'; Kind = 'NuGet'; Length = 1482113; Time = [timespan]::FromSeconds(48.2); Signed = $true; Path = 'C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\ConsoleMonster.2.0.0.nupkg' }
    [pscustomobject] @{ Name = 'ConsoleMonster.2.0.0.snupkg'; Kind = 'NuGet'; Length = 402331; Time = [timespan]::FromSeconds(3.1); Signed = $true; Path = 'C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\ConsoleMonster.2.0.0.snupkg' }
    [pscustomobject] @{ Name = 'ConsoleMonster-2.0.0.zip'; Kind = 'Module'; Length = 2904576; Time = [timespan]::FromSeconds(11.7); Signed = $true; Path = 'C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\ConsoleMonster-2.0.0.zip' }
    [pscustomobject] @{ Name = 'Docs.zip'; Kind = 'Module'; Length = 51302; Time = [timespan]::FromSeconds(1.2); Signed = $false; Path = 'C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\Docs.zip' }
)

Lists and trees

Format-ConsoleList shows one object as a record view. Format-ConsoleTree -AsInspector walks nested objects and collections, with depth, item and node limits.

Format-List

Format-List PowerShell 7.6
Name   : ConsoleMonster.2.0.0.nupkg
Kind   : NuGet
Length : 1482113
Time   : 00:00:48.2000000
Signed : True
Path   : C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\ConsoleMonster.2.0.0.nupkg

Format-ConsoleList

Format-ConsoleList PowerShell 7.6
ConsoleMonster.2.0.0.nupkg
  Kind      NuGet
  Size      1.41 MB
  Built in  48 s
  Signed    ✓ yes
  Path      C:\Support\GitHub\ConsoleMonster\Artefacts\Packed\ConsoleMonster.2.0.0.nupkg
PowerShellformat-consolelist.ps1
. .\artifacts.ps1
$artifacts[0] | Format-ConsoleList -Property Name, Kind, @{ Name = 'Length'; Header = 'Size'; Presenter = 'Bytes' }, @{ Name = 'Time'; Header = 'Built in'; Presenter = 'Duration' }, @{ Name = 'Signed'; Presenter = 'Boolean' }, Path

Format-ConsoleTree -AsInspector

Format-ConsoleTree PowerShell 7.6
mail.evotec.xyz certificate  ·  5 members
Subject       CN=mail.evotec.xyz
Issuer        CN=R11, O=Let's Encrypt, C=US
KeyAlgorithm  ECDSA P-256

SubjectAlternativeNames  3 items
  [0]  mail.evotec.xyz
  [1]  autodiscover.evotec.xyz
  [2]  mta-sts.evotec.xyz

Chain  3 items
  Subject                  Key          Revoked
  ───────────────────────  ───────────  ───────
  CN=mail.evotec.xyz       ECDSA P-256  – no
  CN=R11, O=Let's Encrypt  RSA 2048     – no
  CN=ISRG Root X1          RSA 4096     – no
PowerShellformat-consoletree.ps1
$certificate = [pscustomobject] @{
    Subject                 = 'CN=mail.evotec.xyz'
    Issuer                  = "CN=R11, O=Let's Encrypt, C=US"
    KeyAlgorithm            = 'ECDSA P-256'
    SubjectAlternativeNames = @('mail.evotec.xyz', 'autodiscover.evotec.xyz', 'mta-sts.evotec.xyz')
    Chain                   = @(
        [pscustomobject] @{ Subject = 'CN=mail.evotec.xyz'; Key = 'ECDSA P-256'; Revoked = $false }
        [pscustomobject] @{ Subject = "CN=R11, O=Let's Encrypt"; Key = 'RSA 2048'; Revoked = $false }
        [pscustomobject] @{ Subject = 'CN=ISRG Root X1'; Key = 'RSA 4096'; Revoked = $false }
    )
}
$certificate | Format-ConsoleTree -AsInspector -Title 'mail.evotec.xyz certificate'

The same command on other consoles

Format-ConsoleTable from above, run again with the terminal profile overridden. The script does not change.

16 colours and ASCII glyphs

CONSOLEMONSTER_COLOR=16, CONSOLEMONSTER_GLYPHS=ascii Windows PowerShell 5.1
 PSPublishModule artifacts
+-----------------------------+---------+----------+--------+--------------------------------------+
| Name                        |    Size | Built in | Signed | Path                                 |
+-----------------------------+---------+----------+--------+--------------------------------------+
| NuGet  2                                                                                         |
| ConsoleMonster.2.0.0.nupkg  | 1.41 MB |     48 s | yes    | C:\Support\GitHub...ster.2.0.0.nupkg |
| ConsoleMonster.2.0.0.snupkg |  393 KB |    3.1 s | yes    | C:\Support\GitHub...ter.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...onster-2.0.0.zip |
| Docs.zip                    | 50.1 KB |    1.2 s | no     | C:\Support\GitHub...\Packed\Docs.zip |
| Subtotal                    | 2.82 MB |     13 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+
| Total                       | 4.62 MB | 1 m 04 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+

NO_COLOR

NO_COLOR=1 PowerShell 7.6
 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 │        │                                      │
╰─────────────────────────────┴─────────┴──────────┴────────┴──────────────────────────────────────╯

Plain mode

CONSOLEMONSTER_MODE=plain PowerShell 7.6
 PSPublishModule artifacts
+-----------------------------+---------+----------+--------+--------------------------------------+
| Name                        |    Size | Built in | Signed | Path                                 |
+-----------------------------+---------+----------+--------+--------------------------------------+
| NuGet  2                                                                                         |
| ConsoleMonster.2.0.0.nupkg  | 1.41 MB |     48 s | yes    | C:\Support\GitHub...ster.2.0.0.nupkg |
| ConsoleMonster.2.0.0.snupkg |  393 KB |    3.1 s | yes    | C:\Support\GitHub...ter.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...onster-2.0.0.zip |
| Docs.zip                    | 50.1 KB |    1.2 s | no     | C:\Support\GitHub...\Packed\Docs.zip |
| Subtotal                    | 2.82 MB |     13 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+
| Total                       | 4.62 MB | 1 m 04 s |        |                                      |
+-----------------------------+---------+----------+--------+--------------------------------------+

A 56-column console

56 columns PowerShell 7.6
PSPublishModule artifacts  ·  4 records

NuGet
  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.snupkg

Module
  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.zip

Total
  Size      4.62 MB
  Built in  1 m 04 s

Where the output goes

Cmdlets draw directly only on a real local console. Everywhere else they write through the PowerShell host, line by line as Write-Host does, so jobs complete, transcripts record and 6>&1 captures the output.

Where the script runsWhat ConsoleMonster writes
A real local interactive consoleDrawn directly, with colour and live dashboards.
A real console with Start-Transcript running, and the ISEColoured text through the host UI. The transcript receives the same lines as plain text.
Background jobs and remotingWrite-Host style information records (tag PSHOST) with foreground and background colours.
Redirected output, thread jobs and other hostsOne plain record per line, so files, transcripts and 6>&1 get whole lines of plain text.
NO_COLOR, CONSOLEMONSTER_COLOR=none, plain modeHost output stays uncoloured.

Receive-Job in PowerShell 7.6

Start-Job | Receive-Job PowerShell 7.6
 From a background job
╭───────┬────────╮
│ Check │ Status │
├───────┼────────┤
│ SPF   │ ✓ Pass │
│ DMARC │ ✗ Fail │
╰───────┴────────╯

Receive-Job in Windows PowerShell 5.1

Start-Job | Receive-Job Windows PowerShell 5.1
 From a background job
╭───────┬────────╮
│ Check │ Status │
├───────┼────────┤
│ SPF   │ ✓ Pass │
│ DMARC │ ✗ Fail │
╰───────┴────────╯
PowerShelljob.ps1
$module = (Get-Module ConsoleMonster).Path
Start-Job -ArgumentList $module {
    param($Module)
    Import-Module $Module
    [pscustomobject] @{ Check = 'SPF'; Status = 'Pass' }, [pscustomobject] @{ Check = 'DMARC'; Status = 'Fail' } |
        Write-ConsoleTable -Title 'From a background job' -StatusProperty Status
} | Receive-Job -Wait -AutoRemoveJob

How output behaves in CI, jobs, remoting, SSH, the ISE and transcripts

84 cmdlets

Grouped by verb, with the synopsis from the module's help. Each links to its full reference with syntax, parameters and examples.

Write 10

Format 6

  • Format-ConsoleCodeShows source text with syntax highlighting, line numbers and highlighted lines.
  • Format-ConsoleErrorShows errors and exceptions readably: type, message, position, script stack, frames and inner errors.
  • Format-ConsoleJsonShows JSON with syntax highlighting: JSON text, or objects converted with ConvertTo-Json.
  • Format-ConsoleListFormats pipeline objects as record views (labelled values) and writes them to the host.
  • Format-ConsoleTableFormats pipeline objects as a width-aware table and writes it to the host.
  • Format-ConsoleTreeShows the structure of pipeline objects as a tree (or an inspector view) and writes it to the host.

New 29

Start 2

Update 6

Read 8

Show 5

  • Show-ConsoleShows pipeline input in the view that fits it best.
  • Show-ConsoleChangesShows the changes an action would make and asks before making them: the what-if pattern.
  • Show-ConsoleGridShows pipeline objects in an interactive grid and returns the rows you choose.
  • Show-ConsoleMenuShows a menu until the user exits.
  • Show-ConsoleReplayRewinds a recorded run: an in-terminal player with a timeline, markers, failures, warnings and log search.

Export 2

Invoke 1

Add 1

Assert 1

Clear 1

Compare 1

  • Compare-ConsoleObjectCompares two sets of objects and shows what was added, removed and changed, property by property.

Disable 1

Enable 1

Get 1

Out 1

  • Out-ConsoleDefaultShows objects of registered types through ConsoleMonster and passes everything else to PowerShell's Out-Default.

Register 1

  • Register-ConsoleViewRegisters how a type is shown by Enable-ConsoleFormatting and Out-ConsoleDefault.

Send 1

Set 3

  • Set-ConsoleRegionReplaces the content of a region (New-ConsoleRegion) in the running dashboard.
  • Set-ConsoleThemeSelects the theme used by every ConsoleMonster widget.
  • Set-ConsoleValueSets a value in a running dashboard: a key/value pair, a bar or a stacked-bar segment.

Use 2

  • Use-ConsoleProgressRuns a script and shows its Write-Progress calls as an inline progress area.
  • Use-ConsoleTargetRuns a script block with ConsoleMonster output going somewhere else: a file, a text writer, any target, or a string.

Install

Install-Module ConsoleMonster -Scope CurrentUser
Import-Module ConsoleMonster

That is the 2.0 install once 2.0 is published. It is not on the PowerShell Gallery yet; the Gallery's current release is the 0.0.x module it replaces.

The scripts above run with the module from this repository's source build. Each was started in a Windows pseudo console of a fixed width, with the culture pinned to en-US for both ConsoleMonster and the built-in cmdlets. Live dashboards started with Start-ConsoleDashboard are on the live dashboards page, and prompts, menus and forms on the interactive page.