Project

PSWriteHTML

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

Stars 1,023
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.45.0
Language: PowerShell Updated: 2026-11-03
Command

New-HTMLPage

Module
PSWriteHTML

Creates a new HTML page with specified content, name, title, file path, and ID.

Syntax

New-HTMLPage
[[-FilePath] <String>]
[[-ID] <String>]
[-Name] <String>
[[-PageContent] <ScriptBlock>]
[[-Title] <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new HTML page with the provided content and metadata. It generates a unique GUID for the page and stores it in the global schema. The function returns a custom object representing the page.

Examples

Example 1

<body><h1>Hello, World!</h1></body></html>" } -Name "index" -Title "Welcome Page" -FilePath "C:\Pages\index.html" -ID "12345"

Creates a new HTML page with a simple "Hello, World!" content, named "index", titled "Welcome Page", saved at "C:\Pages\index.html", and with ID "12345".

Parameters

-FilePath String optionalposition: 3
The file path where the HTML page will be saved.
-ID String optionalposition: 4
The ID of the HTML page.
-Name String requiredposition: 1
The name of the HTML page.
-PageContent ScriptBlock optionalposition: 0
The script block containing the HTML content of the page.
-Title String optionalposition: 2
The title of the HTML page.

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.