New-HTMLTree
Creates a new HTML tree using FancyTree with various customization options.
Syntax
New-HTMLTree [-AutoCollapseSibling] [-AutoScroll] [[-Checkbox] <checkbox|radio>] [[-Data] <ScriptBlock>] [-DisableControl] [-DisableIcons] [-DisableKeyboardNavigation] [-EnableChildCounter] [-EnableQuickSearch] [[-MinimumExpandLevel] <Nullable`1>] [[-SelectMode] <1|2|3>] [-WideSelection] [<CommonParameters>]#All Parameter SetsDescription
This function creates a new HTML tree using FancyTree with the ability to customize the tree's appearance and behavior. It supports features like checkboxes, radio buttons, selection modes, icons, keyboard navigation, quick search, child counters, and more.
Examples
EXAMPLE 1
New-HTMLTree -Data {
TreeNode -Node "Root" -Children {
TreeNode -Node "Child 1"
TreeNode -Node "Child 2"
}
} -Checkbox 'checkbox' -SelectMode '3' -EnableChildCounter -WideSelectionCreates a new HTML tree with checkboxes, hierarchical selection mode, child counters, and wide selection enabled.
Parameters
- -AutoCollapseSibling SwitchParameter
- Automatically collapses sibling nodes when a node is expanded.
- -AutoScroll SwitchParameter
- Enables auto-scrolling when navigating the tree.
- -Checkbox String
- Specifies the type of checkboxes to be displayed in the tree. Valid values are 'none', 'checkbox', or 'radio'. Default is 'none'.
- Possible values:
checkbox,radio - -Data ScriptBlock
- The script block that contains the data to populate the tree.
- -DisableControl SwitchParameter
- Disables control features in the tree if this switch is present.
- -DisableIcons SwitchParameter
- Disables icons in the tree if this switch is present.
- Disables keyboard navigation in the tree if this switch is present.
- -EnableChildCounter SwitchParameter
- Enables child counter display in the tree.
- -EnableQuickSearch SwitchParameter
- Enables quick search functionality in the tree.
- -MinimumExpandLevel Nullable`1
- Specifies the minimum level of nodes to expand in the tree.
- -SelectMode Object
- Specifies the selection mode for the tree. Valid values are 'none', '1', '2', or '3'. Default is '2'.
- Possible values:
1,2,3 - -WideSelection SwitchParameter
- Enables wide selection mode in the tree.
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.