Everyday output in one line. The monster when you need it. ConsoleMonster makes the output of the commands you already run readable, and draws tables, trees, charts, live runs, dashboards, menus and forms when you need more. One engine for PowerShell 5.1 and 7 and .NET, with no package dependencies and plain lines when the output is a log.
Website · Documentation · Widgets · Prompts, menus and forms · .NET API · PowerShell commands
Install-Module ConsoleMonster -Scope CurrentUserdotnet new console -n FirstTable
cd FirstTable
dotnet add package ConsoleMonsterFiles, processes, services, hashtables and more read as tables and records; the objects, pipelines, files and transcripts stay PowerShell's.
Enable-ConsoleFormatting
To keep it in every session, add the lines -ProfileSnippet prints to your profile:
if (-not (Test-Path -Path $PROFILE)) {
$null = New-Item -ItemType File -Path $PROFILE -Force
}
Enable-ConsoleFormatting -Feature All -ProfileSnippet | Add-Content -Path $PROFILEFormat-ConsoleTable, Format-ConsoleList and Format-ConsoleTree take pipeline input and fit the window.
Format-Table, Format-List and Format-Wide stay PowerShell's own unless you turn on -Feature FormatCommands.
Import-Module ConsoleMonster
# A few of PowerShell's own files, grouped by extension.
Get-ChildItem -Path $PSHOME -File |
Where-Object Extension -in '.exe', '.json', '.ps1' |
Format-ConsoleTable -Property Name, Length, LastWriteTime -GroupBy Extension
Coming from Format-Table · Tables at six widths
Every widget is a New-Console* command: panels, trees, charts, logs, lanes and more. Containers take a script block
of children, and items share -Status, -Detail and -Tone.
Import-Module ConsoleMonster
New-ConsoleBarChart -Tone Fail ([ordered] @{
'Domain controllers' = 14
'Group Policy' = 9
'Kerberos' = 6
'DNS' = 4
'PKI' = 2
}) | Write-ConsoleWidget
The widget gallery: every widget at every colour and glyph tier, in PowerShell and C#.
Import-Module ConsoleMonster
# Forty servers, eight at a time: three fail and one hangs past the four-second limit.
$servers = 1..40 | ForEach-Object { 'web{0:d2}' -f $_ }
$run = @{ Parallel = $true; ThrottleLimit = 8; TimeoutSeconds = 4; Title = 'Patching' }
$results = $servers | ForEach-ConsoleItem @run -ErrorAction SilentlyContinue {
Start-Sleep -Milliseconds (500 + ([int] $_.Substring(3) * 137) % 900)
if ($_ -in 'web13', 'web26', 'web39') { throw "$_ did not come back" }
if ($_ -eq 'web22') { Start-Sleep -Seconds 10 }
"$_ patched"
}
The same engine as a .NET library. Every widget has fluent With... and Add... methods, object initializers and
Ui factories.
using ConsoleMonster;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;
Terminal.Write(new StatusList()
.Add("Restore NuGet packages", StatusKind.Pass, "1.6 s")
.Add("Compile ConsoleMonster", StatusKind.Pass, "4.7 s")
.Add("Run Pester on PowerShell 7", StatusKind.Warn, "1 skipped")
.Add("Sign module files", StatusKind.Skip, "skipped")
.Add("Pack ConsoleMonster.2.0.0.nupkg", StatusKind.Running)
.Add("Publish to PowerShell Gallery", StatusKind.Pending));
Three ways to write it in C# · Logging · Hosting dashboard · dotnet new template
Views export to Markdown, HTML, SVG and text, live runs record and replay, and Assert-ConsoleOutput checks output in
tests.
Import-Module ConsoleMonster
# The largest files in PowerShell's folder, as a Markdown table for a report.
Get-ChildItem -Path $PSHOME -File |
Sort-Object -Property Length -Descending |
Select-Object -First 5 |
Format-ConsoleTable -Property Name, Length, LastWriteTime -As Markdown
Recording and replay · Testing your output
Any thread can update the screen and one thread draws it, so parallel work never tears the view.
Import-Module ConsoleMonster
$dashboard = New-ConsoleDashboard -Title 'Workers' {
New-ConsolePanel -Title 'Log' -Fill { New-ConsoleLog }
}
1..8 | Start-ConsoleDashboard $dashboard -Parallel -ThrottleLimit 8 {
param($Number)
Start-Sleep -Milliseconds (Get-Random -Maximum 800)
Write-Host "worker $Number finished"
}Threads and concurrency: what is safe from which thread, and the stress test.
- PowerShell 5.1 and 7. On 5.1 one ConsoleMonster version loads per session; restart it after an upgrade.
- .NET netstandard2.0, net472, net8.0 and net10.0, no package dependencies, AOT compatible on net8.0 and net10.0 (trimming notes).
- Consoles are detected (colour, glyphs, size, CI, redirection);
NO_COLORandCONSOLEMONSTER_*override it (hosts and CI, upgrading from 0.0.x).
Benchmarks · Changelog · Contributing · MIT license · Maintained by Evotec.