# New-HTMLTreeNode

Creates a new HTML tree node with specified properties.

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 **115**

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 node with specified properties.

## Syntax

```
New-HTMLTreeNode
[[-Checkbox] <checkbox|radio>]
[[-Children] <ScriptBlock>]
[-Folder]
[[-HrefLink] <String>]
[[-Icon] <String>]
[[-IconTooltip] <String>]
[[-Id] <String>]
[-IsExpanded]
[-IsSelected]
[[-Target] <String>]
[[-Title] <String>]
[[-Tooltip] <String>]
[-Unselectable]
[<CommonParameters>]
```

[#](#method-new-htmltreenode-string-scriptblock-switchparameter-string-string-string-string-switchparameter-switchparameter-string-string-string-switchparameter)

Parameter set: `All Parameter Sets`

## Description

This function creates a new HTML tree node with the specified properties. It allows for customization of various attributes such as title, ID, folder structure, tooltip, icon, selection status, expansion status, etc.

## Examples

### Example 1

```powershell
New-HTMLTreeNode -Title "Folder 1" -Id "folder1" -Folder -Children {
    New-HTMLTreeNode -Title "Item 1" -Id "item1"
    New-HTMLTreeNode -Title "Item 2" -Id "item2"
}
```

### Example 2

```powershell
New-HTMLTreeNode -Title "Document" -Id "doc1" -HrefLink "https://example.com" -Target "_blank"
```

## Parameters

**-Checkbox String optionalposition: 6**

Specifies the type of checkbox for the tree node. Valid values are 'none', 'checkbox', or 'radio'.

Possible values: `checkbox`, `radio`

**-Children ScriptBlock optionalposition: 0**

Specifies the script block that defines the children nodes of the tree node.

**-Folder SwitchParameter optional**

Indicates whether the tree node represents a folder.

**-HrefLink String optionalposition: 7aliases: Href, Link, Url, UrlLink**

Specifies the URL link for the tree node.

**-Icon String optionalposition: 4**

Specifies the icon for the tree node.

**-IconTooltip String optionalposition: 5**

Specifies the tooltip text for the icon.

**-Id String optionalposition: 2**

Specifies the unique identifier of the tree node.

**-IsExpanded SwitchParameter optionalaliases: Expanded**

Indicates whether the tree node is expanded.

**-IsSelected SwitchParameter optional**

Indicates whether the tree node is selected.

**-Target String optionalposition: 8**

Specifies the target window for the URL link. Valid values are "_blank", "_self", "_parent", "_top", or a frame name.

**-Title String optionalposition: 1**

Specifies the title of the tree node.

**-Tooltip String optionalposition: 3**

Specifies the tooltip text for the tree node.

**-Unselectable SwitchParameter optional**

Indicates whether the tree node is unselectable.

## 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:063877790750E8FEB268F5EC59BE46A6CD63F4C06F618E00DF7C014FC06ABF5C -->
