Format-SpectreTree
Description
This function takes a hashtable and formats it as a tree using Spectre Console. The hashtable should have a ‘Value’ key and a ‘Children’ key. The ‘Value’ key should contain the Spectre Console renderable item (text or other objects like calendars etc.) for the node of the tree, and the ‘Children’ key should contain an array of hashtables representing the child nodes of the node.
See https://spectreconsole.net/widgets/tree for more information.
Examples
Example 1
This example demonstrates how to display a tree with multiple children.
Parameters
Data
The hashtable to format as a tree.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Hashtable] | true | 1 | true (ByValue) |
Guide
The type of line to use for the tree.
Valid Values:
- Ascii
- BoldLine
- DoubleLine
- Line
Type | Required | Position | PipelineInput | Aliases |
---|---|---|---|---|
[String] | false | 2 | false | Border |
Color
The color to use for the tree. This can be a Spectre Console color name or a hex color code. Default is the accent color defined in the script.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Color] | false | 3 | false |