Skip to content
ConsoleMonster
Cmdlet

Format-ConsoleTree

Module ConsoleMonster
Inputs
System.Management.Automation.PSObject

Shows the structure of pipeline objects as a tree (or an inspector view) and writes it to the host.

Syntax

Format-ConsoleTree [-AsInspector] [-Culture <CultureInfo>] [-Depth <Int32>] [-Exclude <String[]>] [-Include <String[]>] [-InputObject <PSObject>] [-MaxItems <Int32>] [-MaxNodes <Int32>] [-PassThru] [-Title <Object>] [-Width <Int32>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Shows the structure of pipeline objects as a tree (or an inspector view) and writes it to the host.

Works for any object: PSCustomObjects, .NET objects, hashtables and dictionaries, nested to -Depth levels. Collections list up to -MaxItems items followed by "+N more"; reference cycles and the depth limit are marked instead of recursing forever. -Include and -Exclude filter member names (wildcards). With -AsInspector the object is shown as a record view: nested objects as indented sections and uniform collections as nested tables. Redirected output is plain text.

Examples

Authored help example

EXAMPLE 1

Format-ConsoleTree -AsInspector

Parameters

-AsInspector SwitchParameter optional
Shows a record view (sections and nested tables) instead of a tree.
-Culture CultureInfo optional
The culture for numbers and dates, for example en-US or pl-PL (labels stay English). Defaults to CONSOLEMONSTER_CULTURE, then the current culture, as PowerShell's own formatting does.
-Depth Int32 optional
How deep nested objects are followed (default 3).
-Exclude String[] optional
Member names to leave out (wildcards).
-Include String[] optional
Member names to show (wildcards); others are left out.
-InputObject PSObject optionalpipeline: True (ByValue)
The objects to show (pipeline input).
-MaxItems Int32 optional
The most items listed per collection before "+N more" (default 25).
-MaxNodes Int32 optional
The most nodes one object may expand into (default 5000); beyond it a "node limit reached" marker ends the expansion. Wide objects grow as members to the power of -Depth.
-PassThru SwitchParameter optional
Also writes the input objects to the pipeline.
-Title Object optional
The root label (default: the object's type name).
-Width Int32 optional
Lays the output out for this width instead of the terminal's.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.