# New-HTMLTree

Creates a new HTML tree using FancyTree with various customization options.

Project

PSWriteHTML

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

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**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>]
```

[#](#method-new-htmltree-switchparameter-switchparameter-string-scriptblock-switchparameter-switchparameter-switchparameter-switchparameter-switchparameter-nullable-object-switchparameter)

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

### Example 1

```powershell
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<T> 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:2442C9E51871F704C0D52B636B4E22B6BDE12CF352C5FFEF418399CDC4FFED1A -->
