ConsoleMonster.PowerShell.Display 2.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ConsoleMonster.PowerShell.Display --version 2.1.1
                    
NuGet\Install-Package ConsoleMonster.PowerShell.Display -Version 2.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConsoleMonster.PowerShell.Display" Version="2.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConsoleMonster.PowerShell.Display" Version="2.1.1" />
                    
Directory.Packages.props
<PackageReference Include="ConsoleMonster.PowerShell.Display" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConsoleMonster.PowerShell.Display --version 2.1.1
                    
#r "nuget: ConsoleMonster.PowerShell.Display, 2.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConsoleMonster.PowerShell.Display@2.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConsoleMonster.PowerShell.Display&version=2.1.1
                    
Install as a Cake Addin
#tool nuget:?package=ConsoleMonster.PowerShell.Display&version=2.1.1
                    
Install as a Cake Tool

Optional PowerShell default display

ConsoleMonster.PowerShell.Display provides a runspace-owned default display broker without importing the ConsoleMonster command module. It targets .NET Framework 4.7.2, .NET 8 and .NET 10. Its ABI epoch is 1 (AssemblyVersion 1.0.0.0); package versions move independently.

The CLR identity is declared in AssemblyInfo.cs, with SDK assembly-version generation disabled. Package publisher version overrides therefore cannot change the ABI epoch's assembly identity. The package ships with the aligned 2.1.0 release.

Acquire a ModuleLease with DefaultDisplay.RegisterModule(moduleName, moduleVersion, ownedTypeNames, minimumFeatureLevel, source). List each owned CLR type by its exact full name. A product lease cannot register system types, dictionaries, deserialized objects, formatting records, namespace wildcards or PSCustomObject.

Register a view through lease.Register(typeName, viewId, version, batch, scopeKey, builder, budget, scopeSelector, runtimeType). The builder accepts IReadOnlyList<object> and DefaultDisplayContext, and returns IWidget. Input values are the original PSObject.BaseObject references. The adapter never adds properties or type names. Product presentation assemblies can depend on core ConsoleMonster alone: the module's registration lambda converts the batch to domain types and passes context.Profile to its pure presentation builder.

Pass runtimeType: typeof(YourModel) for every builder that casts its inputs. This requires exact CLR type identity, so two private assembly contexts can register the same full type name and view version with separate typed builders. Releasing one lease preserves the other context and any equal-version backups for its own type. Leave it null for declarative or generic name-based views. Explicit user views retain their higher priority.

ScopeKey contains materialized field or auto-property names. An optional pure Func<object, string> selector can obtain an immutable external run identity without adding a field to the result model. A selector failure delegates that record natively and uses the same once-per-view verbose diagnostic as a builder failure. Neither selectors nor builders should perform I/O or access lazy properties.

Dispose the lease from the importing module's removal hook. Each import retains its own registrations; removing one import reveals any surviving compatible registration. Equal or lower versions do not replace an earlier view. Higher versions replace the same view ID within the same major version. Explicit user views precede command-module views, then product views. A module requiring a newer feature level remains native and receives one verbose update/new-session hint.

The broker installs only when the effective Out-Default is PowerShell's Microsoft.PowerShell.Core cmdlet. It preserves custom functions and aliases. On final release it removes the broker only when the installed ScriptBlock is still its own. User replacements remain. Set-ConsoleDefaultDisplay -Module <name> -Mode Auto|Plain|Off sets a runspace user preference; omit -Module for all modules. CONSOLEMONSTER_DEFAULT_VIEWS=0 disables automatic views for the process. No profile file is edited.

The command module's FormatCommands and Help routes recognize the actual owned broker instance through DefaultDisplay.IsOwnedBroker(CommandInfo). A copied function body does not establish ownership. Their capture and transcript checks still apply.

Automatic rich output requires an actual local ConsoleHost console handle, readable inactive transcription state, automatic submission provenance, and no output/error redirection, CI or remoting. Unknown routes remain native. A physical console in Plain mode remains eligible: Plain, NO_COLOR and PowerShell's PlainText output style retain layout without SGR decoration. Explicit Format-*, Out-String, file output, capture and serialization retain PowerShell's object and native-formatting paths.

After confirming host eligibility, colored output snapshots CurrentHostColors from the current host's RawUI foreground/background pair and applies the core per-render default colors. Single and Collect frames, adaptive single views and native-budget footers use the pair read before their preparation. A Stream keeps its opening pair for its rows and closing footer. If either host color cannot be read, the affected output uses native formatting. This preserves ordinary host color customizations through encoded style resets without changing process-wide colors or terminal defaults. Plain and NO_COLOR output remain undecorated and do not need a color snapshot; capture and transcript routes remain native.

Single prepares and budget-checks the entire encoded widget before one host write. A builder or widget exception emits no partial rich frame, then delegates the originals natively. The diagnostic is verbose, once per view per runspace. A host transport failure is propagated because replaying after a partial transport write could duplicate output.

Stream uses core GroupedStreamingTable state across incoming records. Its builder returns one Table row with stable column definitions. At opening, the adapter allocates terminal space using each column's MinWidth, MaxWidth, Width, Priority, key and flexible hints. Numeric columns retain right alignment. Later rows cannot resize the grid: overflow truncates with an ellipsis instead of wrapping. Columns with lower priority hide first when the declared minimums cannot fit; the notice names them. Narrow record-card behavior below 60 columns remains available. The adapter copies column definitions and does not modify the builder's prototype.

The automatic host route samples at most 200 original rows, within the view's record and byte budget. It checks the 250 ms boundary on each arrival and normal completion. A scope that completes before the boundary uses CollectedBuilder when configured; otherwise the adapter assembles its sampled table. An open scope freezes widths from the held sample, prints one header, and appends later rows without resizing. A quiet producer pause can delay its first frame until the next arrival or completion: no timer writes through the host. The explicit DefaultDisplayStream.Append API continues to prepare each row immediately.

Set SingleRecordBuilder for a detailed one-record scope that closes within the sample window. The broker freezes that callback at the first record. Set CollectedBuilder for a completed sample and StreamingHeaderBuilder for an open stream; the opening header must describe collection, without a final verdict. Configure these callbacks before the scope starts. Assign registration.Streaming = new DefaultDisplayStreaming(seed, aggregate, summary) for bounded per-group closure aggregates; otherwise the summary is a row count. Early disposal does not build a completion summary. Initial preparation finishes before a host write, so a failure delegates every held original natively. Set ScopeKey to null when different computers belong to one table. Scope, type, observable automatic error and merged-stream boundaries still close the current segment.

Collect holds at most 2,000 records and 16 MiB estimated data. It renders on normal end, a scope change, another view/type, or an observable automatic error boundary. Exceeding either budget replays the originals natively from the first held record, keeps the remainder native, and prints a count footer. Builder, widget and encoded-output failures replay the complete original segment natively; a renderer never writes a partial frame. Consecutive completed rich views within a submission have one blank separator; the final view does not add a trailing blank line.

With the default (unmerged) streams, warnings and verbose messages can appear before the table they relate to. Use *>&1 to keep producer order. Independent warning, verbose and information output remains native and is neither intercepted nor captured. Observable automatic errors close a held segment first. Merged warning, verbose, information and error records close segments in producer order, including error-only 2>&1 routing.

An uncaught producer error aborts the pipeline without a normal end callback. As with native incomplete formatted output, the adapter does not render a late completion frame. Its pipeline-lifetime observer only releases held references and transient state; it never renders from an event callback. If the engine's current pipeline/lifecycle cannot be observed, Collect and Stream remain native from the first record.

Rich preparation uses the opt-in ConsoleViewStyle context, shared with ConsoleViewFrame. It supplies compact health glyphs, the console-view palette and percentages such as 68%. Ordinary ConsoleMonster rendering retains its existing glyphs, palette, percentage spacing and bar shapes. A supplied custom theme remains in effect. This is scoped to a render; it does not change terminal defaults or process settings. Below-row columns keep their evidence in streamed continuations, and repeated identity values can be muted without removing their text.

After one second of collection, an arriving record can update a muted collecting line on a confirmed host. The helper writes a complete physical line and qualifies the RawUI owned-region eraser before returning to the producer. If the eraser is unavailable, it rolls back while cursor ownership is certain and disables status updates. It also declines status at the bottom of the physical buffer, where writing another line would scroll the owned region. Later cleanup clears only still-identical owned characters; it does not move over intervening native messages or erase their cells. If external scrolling or overwriting invalidates ownership, the helper disables further updates and does not erase unproven cells. Plain/NO_COLOR and PSStyle PlainText use undecorated text. Status updates recheck the host route and never write text while output or errors are redirected or transcription is active. If transcription starts after a status line appears, cleanup erases only its verified console cells through RawUI without adding text to the transcript. There is no timer callback: a quiet producer pause does not itself trigger an update. The qualified status line is erased before a completed view and released on pipeline abort.

Schema v2 is data-only. ConsoleViewDocument.Read/Parse/ParseText validates the whole document before registering it with a lease. ParseText(string) accepts resource text directly: it requires a single literal HashtableAst, rejects parser errors and other statements, and obtains values through PowerShell's parameterless Ast.SafeGetValue() on both PowerShell 5.1 and 7. It then applies the same recursive data snapshot and schema validation as Parse(IDictionary). Read an embedded resource during module registration and call ConsoleViewDocument.ParseText(text).Register(lease); the pure presentation builder needs no file or PowerShell dependency.

The schema supports batch/scope, child or edge properties, cycle/repeat flags, data templates, conditional tones, column priorities, bounded budgets, native/table over-budget choices and registered compiled builders. No nested script blocks, delegates or executable values are allowed. Existing command-module schema 1 files retain their reader. Schema 2 files use the shared registry, including Register-ConsoleView -Path and Unregister-ConsoleView -Path.

Declarative cells retain typed values only for known BCL scalars: strings, primitives, enums, decimal, DateTime, DateTimeOffset, TimeSpan and Guid. Other values use their type label without invoking application formatters. Materialized fields and auto-properties are read without running application getters; tree flags require actual booleans.

Command-module file definitions remain saved when Output is disabled, while their active leases are released. Enabling Output restores those definitions; registering a file while disabled saves it without activating it. Unregister removes saved entries as well as active entries and reports whether an entry existed. Removing the command module releases its file leases and saved definitions. Product leases remain independent.

The adapter does not implement assembly resolution or load a second runtime. Embedded products must use their canonical shared assembly loader before registering views.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 122 10/29/2026
2.1.1 136 10/29/2026
2.1.0 85 10/28/2026