Evotec

Project

PSWriteHTML

PSWriteHTML is an open-source PowerShell project with packages, release history, and working documentation.

Stars 995
Forks 114
Open issues 69
PowerShell Gallery downloads 7,436,513
Release v1.41.0
Language: PowerShell Updated: 2026-04-11

API Reference

Function

New-HTMLOrgChart

Namespace PSWriteHTML

Creates an HTML organizational chart based on the provided nodes and options.

Remarks

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

Authored help example

EXAMPLE 1


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
        

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.

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

Parameters

AllowExport SwitchParameter optionalposition: namedpipeline: False
Enables the export button for the org chart.
ChartID String optionalposition: 9pipeline: False
Specifies a custom ID for the org chart. If not provided, a random ID will be generated.
ChartNodes ScriptBlock optionalposition: 0pipeline: False
Specifies the nodes to be displayed on the chart. This parameter should contain a script block defining the organizational structure.
Direction String optionalposition: 1pipeline: Falsevalues: 4
Specifies the layout direction of the chart. Available values are "TopToBottom" (default), "BottomToTop", "LeftToRight", and "RightToLeft".
Possible values: TopToBottom, BottomToTop, LeftToRight, RightToLeft
Draggable SwitchParameter optionalposition: namedpipeline: False
Enables dragging and dropping nodes within the org chart. Note: This feature is not supported on Internet Explorer.
ExportExtension Object optionalposition: 8pipeline: Falsevalues: 2
Specifies the format for exporting the org chart. Available values are "png" and "pdf".
Possible values: png, pdf
ExportFileName String optionalposition: 7pipeline: False
Specifies the filename when exporting the org chart as an image.
NodeTitle String optionalposition: 4pipeline: False
Sets the text content of the title section of each org chart node.
Pan SwitchParameter optionalposition: namedpipeline: False
Enables panning the org chart by mouse drag and drop.
ToggleSiblings SwitchParameter optionalposition: namedpipeline: False
Enables the ability to show/hide left and right sibling nodes by clicking arrows.
VerticalLevel Int32 optionalposition: 3pipeline: False
Aligns the nodes vertically starting from the specified level.
VisileLevel Int32 optionalposition: 2pipeline: False
Sets the initial visibility level of the org chart.
Zoom SwitchParameter optionalposition: namedpipeline: False
Enables zooming in and out of the org chart using the mouse wheel.
ZoomInLimit Double optionalposition: 5pipeline: False
Sets the maximum zoom-in limit.
ZoomOutLimit Double optionalposition: 6pipeline: False
Sets the maximum zoom-out limit.