# New-HTMLOrgChart

Creates an HTML organizational chart based on the provided nodes and 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 an HTML organizational chart based on the provided nodes and options.

## Syntax

```
New-HTMLOrgChart
[-AllowExport]
[[-ChartID] <String>]
[[-ChartNodes] <ScriptBlock>]
[[-Direction] <TopToBottom|BottomToTop|LeftToRight|RightToLeft>]
[-Draggable]
[[-ExportExtension] <png|pdf>]
[[-ExportFileName] <String>]
[[-NodeTitle] <String>]
[-Pan]
[-ToggleSiblings]
[[-VerticalLevel] <Int32>]
[[-VisileLevel] <Int32>]
[-Zoom]
[[-ZoomInLimit] <Double>]
[[-ZoomOutLimit] <Double>]
[<CommonParameters>]
```

[#](#method-new-htmlorgchart-switchparameter-string-scriptblock-string-switchparameter-object-string-string-switchparameter-switchparameter-int32-int32-switchparameter-double-double)

Parameter set: `All Parameter Sets`

## Description

This function generates an interactive HTML organizational chart based on the specified nodes and customization options. Users can define the layout direction, initial visibility level, vertical alignment, and various interactive features like panning, zooming, dragging, and exporting.

## Examples

### Example 1

```powershell
New-HTML {
    New-HTMLOrgChart {
        New-OrgChartNode -Name 'CEO' -Title 'Chief Executive Officer' {
            New-OrgChartNode -Name 'Manager' -Title 'Manager'
            New-OrgChartNode -Name 'Supervisor' -Title 'Supervisor'
            New-OrgChartNode -Name 'Employee' -Title 'Employee' {
                New-OrgChartNode -Name 'Assistant' -Title 'Assistant'
            }
        }
    } -AllowExport -ExportExtension pdf -Draggable
} -FilePath $PSScriptRoot\OrgChart.html -ShowHTML -Online
```

## Parameters

**-AllowExport SwitchParameter optional**

Enables the export button for the org chart.

**-ChartID String optionalposition: 9**

Specifies a custom ID for the org chart. If not provided, a random ID will be generated.

**-ChartNodes ScriptBlock optionalposition: 0**

Specifies the nodes to be displayed on the chart. This parameter should contain a script block defining the organizational structure.

**-Direction String optionalposition: 1**

Specifies the layout direction of the chart. Available values are "TopToBottom" (default), "BottomToTop", "LeftToRight", and "RightToLeft".

Possible values: `TopToBottom`, `BottomToTop`, `LeftToRight`, `RightToLeft`

**-Draggable SwitchParameter optional**

Enables dragging and dropping nodes within the org chart. Note: This feature is not supported on Internet Explorer.

**-ExportExtension Object optionalposition: 8**

Specifies the format for exporting the org chart. Available values are "png" and "pdf".

Possible values: `png`, `pdf`

**-ExportFileName String optionalposition: 7**

Specifies the filename when exporting the org chart as an image.

**-NodeTitle String optionalposition: 4**

Sets the text content of the title section of each org chart node.

**-Pan SwitchParameter optional**

Enables panning the org chart by mouse drag and drop.

**-ToggleSiblings SwitchParameter optional**

Enables the ability to show/hide left and right sibling nodes by clicking arrows.

**-VerticalLevel Int32 optionalposition: 3**

Aligns the nodes vertically starting from the specified level.

**-VisileLevel Int32 optionalposition: 2**

Sets the initial visibility level of the org chart.

**-Zoom SwitchParameter optional**

Enables zooming in and out of the org chart using the mouse wheel.

**-ZoomInLimit Double optionalposition: 5**

Sets the maximum zoom-in limit.

**-ZoomOutLimit Double optionalposition: 6**

Sets the maximum zoom-out limit.

## 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:8610C3B7CBCB9F3D9583A1FB466645C6DD7E34BA3417A76E2F7566D0EF47557B -->
