Skip to content
ConsoleMonster

Disk usage review

Show storage pressure with threshold bars, a folder breakdown and a clear summary of remaining capacity.

Demos Reports

Use it when a storage report should explain both capacity pressure and where the space went.

  • Static
  • 100×28
  • PowerShell 7.4+
  • .NET 8.0+
Disk usage review 100×2824-bitFull

How it's built

The whole program in one file, with its sample data at the top. It drew the recording above; both languages draw the same cells.

PowerShelldisk-usage.ps1View on GitHub
# Turn a storage inventory into threshold bars and a directory breakdown.
param([switch] $StaticSnapshot, [ValidateRange(0, 0)][int] $Step = 0)
Import-Module ConsoleMonster

# Data: synthetic sizes in GiB and platform-neutral paths; no filesystem scan is performed.
$used = [ordered] @{ Workspace = 62; Cache = 88; Artifacts = 94; Archive = 35 }
$folders = [ordered] @{
    './workspace' = [ordered] @{ src = '12 GiB'; packages = '31 GiB'; fixtures = '19 GiB' }
    './cache' = [ordered] @{ dependencies = '63 GiB'; downloads = '25 GiB' }
    './artifacts' = [ordered] @{ current = '18 GiB'; history = '76 GiB' }
}

# Layout: bars answer where pressure is; the tree explains what occupies the space.
$report = New-ConsoleRows -Gap 1 {
    New-ConsoleRule '[bold]Storage review[/] [muted]· capacity planning[/]'
    New-ConsoleColumns {
        New-ConsolePanel -Title 'Used / 100 GiB' {
            New-ConsoleBarChart -Data $used -Maximum 100 -Unit '%' -Warning 80 -Critical 90
        }
        New-ConsolePanel -Title 'Largest folders' {
            New-ConsoleTree -Title './' -Data $folders
        }
    }
    New-ConsolePanel -Title 'Next action' {
        '[warn]Artifacts is at 94%.[/] Review the retention policy before the next build.'
        '[muted]Keep the current release; archive history older than 30 days.[/]'
    }
}

# Behaviour: print once. Review recommendations before connecting any cleanup action.
$report | Write-ConsoleWidget
C#Program.csView on GitHub
// Turn a storage inventory into threshold bars and a directory breakdown.
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Widgets;

// Data: synthetic sizes in GiB and platform-neutral paths; no filesystem scan is performed.
var used = new[] { (Name: "Workspace", Percent: 62), (Name: "Cache", Percent: 88),
    (Name: "Artifacts", Percent: 94), (Name: "Archive", Percent: 35) };
var folders = new[] {
    (Path: "./workspace", Children: new[] { ("src", "12 GiB"), ("packages", "31 GiB"), ("fixtures", "19 GiB") }),
    (Path: "./cache", Children: new[] { ("dependencies", "63 GiB"), ("downloads", "25 GiB") }),
    (Path: "./artifacts", Children: new[] { ("current", "18 GiB"), ("history", "76 GiB") })
};

// Layout: bars answer where pressure is; the tree explains what occupies the space.
BarChart chart = new BarChart { Max = 100, Unit = "%", Warning = 80, Critical = 90 };
foreach (var volume in used) chart.Add(volume.Name, volume.Percent);
Tree tree = new Tree("./");
foreach (var folder in folders) {
    TreeNode node = tree.Add(folder.Path);
    foreach (var child in folder.Children) node.Add(child.Item1, null, child.Item2);
}
Rows report = new Rows(
    new Rule("[bold]Storage review[/] [muted]· capacity planning[/]"),
    new Columns(new Panel(chart, "Used / 100 GiB"), new Panel(tree, "Largest folders")),
    new Panel(new Rows(
        new TextBlock("[warn]Artifacts is at 94%.[/] Review the retention policy before the next build."),
        new TextBlock("[muted]Keep the current release; archive history older than 30 days.[/]")), "Next action")) { Gap = 1 };

// Behaviour: print once. Review recommendations before connecting any cleanup action.
Terminal.Write(report);

Run it yourself

Three steps in PowerShell, four in C#. Every command copies with one click.

  1. Install the module

    Once. Windows PowerShell 5.1 or PowerShell 7 on Windows, macOS or Linux.

    Install-Module ConsoleMonster -Scope CurrentUser
  2. Save the program

    Download it, or copy it from above into disk-usage.ps1.

  3. Run it

    From the folder you saved it in.

    ./disk-usage.ps1
  1. Create a project

    A plain console app; .NET 8 or later.

    dotnet new console -n Diskusage; cd Diskusage
  2. Add ConsoleMonster

    The only package the program needs.

    dotnet add package ConsoleMonster
  3. Replace Program.cs

    Download it, or copy the program from above.

  4. Run it

    dotnet run

Or skip the copying. Every demo ships with the module and the project template.

Show-ConsoleDemo disk-usage
Get-ConsoleDemo disk-usage -Path ./disk-usage.ps1
dotnet new install ConsoleMonster.Templates
dotnet new consolemonster --demo disk-usage -n Diskusage

Make it yours

Start with these, then read the rest of the file.

  1. Replace the synthetic capacities and folder sizes with one collected inventory.

  2. Choose warning and critical thresholds for your volumes.

  3. Adjust the retention recommendation without attaching deletion to the report.

More reports

All demos