Format-ConsoleTree
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>]#All Parameter SetsDescription
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
EXAMPLE 1
Format-ConsoleTree -AsInspectorParameters
- -AsInspector SwitchParameter
- Shows a record view (sections and nested tables) instead of a tree.
- -Culture CultureInfo
- 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
- How deep nested objects are followed (default 3).
- -Exclude String[]
- Member names to leave out (wildcards).
- -Include String[]
- Member names to show (wildcards); others are left out.
- -InputObject PSObject
- The objects to show (pipeline input).
- -MaxItems Int32
- The most items listed per collection before "+N more" (default 25).
- -MaxNodes Int32
- 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
- Also writes the input objects to the pipeline.
- -Title Object
- The root label (default: the object's type name).
- -Width Int32
- 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.