Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

New-HTMLTree

Module PSWriteHTML

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>]
#
Parameter set: All Parameter Sets

Description

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

Authored help example

EXAMPLE 1

New-HTMLTree -Data {
    TreeNode -Node "Root" -Children {
        TreeNode -Node "Child 1"
        TreeNode -Node "Child 2"
    }
} -Checkbox 'checkbox' -SelectMode '3' -EnableChildCounter -WideSelection

Creates a new HTML tree with checkboxes, hierarchical selection mode, child counters, and wide selection enabled.

Parameters

-AutoCollapseSibling SwitchParameter optional
Automatically collapses sibling nodes when a node is expanded.
-AutoScroll SwitchParameter optional
Enables auto-scrolling when navigating the tree.
-Checkbox String optionalposition: 1
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 optionalposition: 0
The script block that contains the data to populate the tree.
-DisableControl SwitchParameter optional
Disables control features in the tree if this switch is present.
-DisableIcons SwitchParameter optional
Disables icons in the tree if this switch is present.
-DisableKeyboardNavigation SwitchParameter optional
Disables keyboard navigation in the tree if this switch is present.
-EnableChildCounter SwitchParameter optional
Enables child counter display in the tree.
-EnableQuickSearch SwitchParameter optional
Enables quick search functionality in the tree.
-MinimumExpandLevel Nullable`1 optionalposition: 3
Specifies the minimum level of nodes to expand in the tree.
-SelectMode Object optionalposition: 2
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 optional
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.