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-HTMLDiagram

Module PSWriteHTML

Creates a new HTML diagram with customizable options.

Syntax

New-HTMLDiagram [[-BackGroundImage] <Uri>] [[-BackgroundSize] <String>] [-BundleImages] [[-Diagram] <ScriptBlock>] [-DisableLoader] [-EnableFiltering] [-EnableFilteringButton] [[-Height] <Object>] [[-MinimumFilteringChars] <Int32>] [-NoAutoResize] [[-Width] <Object>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new HTML diagram with customizable options such as diagram data, height, width, image bundling, background image, background size, auto-resize, loading bar, filtering, and more.

Examples

Authored help example

EXAMPLE 1

New-HTMLDiagram -Diagram {
    // Diagram configuration settings here
} -Height 500 -Width 800 -BundleImages -BackGroundImage 'https://example.com/background.jpg' -BackgroundSize 'cover' -DisableLoader -EnableFiltering -MinimumFilteringChars 2 -EnableFilteringButton

Creates a new HTML diagram with custom configuration settings including height, width, bundled images, background image, disabled loading bar, enabled filtering, and a filtering button.

EXAMPLE 2

New-HTMLDiagram -Diagram {
    // More diagram configuration settings
} -Height 600 -Width 1000

Creates a new HTML diagram with additional configuration settings and default options for height and width.

Parameters

-BackGroundImage Uri optionalposition: 3
Specifies the background image for the diagram.
-BackgroundSize String optionalposition: 4
Specifies the size of the background image. Default is '100% 100%'.
-BundleImages SwitchParameter optional
Indicates whether to bundle images used in the diagram.
-Diagram ScriptBlock optionalposition: 0
Specifies the diagram data to be displayed. This should be a ScriptBlock containing the diagram configuration.
-DisableLoader SwitchParameter optionalaliases: DisableLoadingBar
Indicates whether the loading bar should be disabled.
-EnableFiltering SwitchParameter optional
Indicates whether filtering functionality is enabled.
-EnableFilteringButton SwitchParameter optional
Indicates whether a filtering button should be displayed.
-Height Object optionalposition: 1
Specifies the height of the diagram.
-MinimumFilteringChars Int32 optionalposition: 5
Specifies the minimum number of characters required for filtering.
-NoAutoResize SwitchParameter optional
Indicates whether auto-resize functionality is disabled.
-Width Object optionalposition: 2
Specifies the width of the diagram.

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.