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

Module PSWriteHTML

Creates HTML content from Markdown text with customizable options.

Syntax

New-HTMLMarkdown [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] -FilePath <String> [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [<CommonParameters>]
#
Parameter set: FilePath
New-HTMLMarkdown [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [-ScriptBlock] <ScriptBlock> [<CommonParameters>]
#
Parameter set: ScriptBlock
New-HTMLMarkdown -Content <Array> [-DisableTables] [-EnableBackslashEscapes] [-EnableBackslashEscapesHTMLTags] [-EnableEmoji] [-EnableEncodeEmails] [-EnableGithubCodeBlocks] [-EnableMoreStyling] [-EnableOpenLinksInNewWindow] [-EnableRequireSpaceBeforeHeadingText] [-EnableSimpleLineBreaks] [-EnableStrikethrough] [-EnableTaskLists] [-EnableTOC] [-Encoding <String>] [-HeaderLevelStart <Int32>] [-Id <String>] [-omitExtraWLInCodeBlocks] [-SanitezeHTML] [<CommonParameters>]
#
Parameter set: Content

Description

The New-HTMLMarkdown function converts Markdown text to HTML content with various customization options such as strikethrough, emojis, code block styling, table of contents, and more.

Examples

Authored help example

EXAMPLE 1

New-HTMLMarkdown -FilePath "C:\Markdown\example.md" -EnableStrikethrough -EnableEmoji -EnableTOC

Converts the Markdown content from the file "example.md" to HTML with strikethrough, emojis, and a table of contents.

EXAMPLE 2

$MarkdownContent = @("## Title", "This is a **bold** text.")
New-HTMLMarkdown -Content $MarkdownContent -EnableMoreStyling -EnableTaskLists

Converts the Markdown content in the array with additional styling and task list support.

Parameters

-DisableTables SwitchParameter optional
Switch parameter to disable table rendering.
-EnableBackslashEscapes SwitchParameter optional
Switch parameter to enable backslash escapes.
-EnableBackslashEscapesHTMLTags SwitchParameter optional
Switch parameter to enable backslash escapes for HTML tags.
-EnableEmoji SwitchParameter optional
Switch parameter to enable emoji support.
-EnableEncodeEmails SwitchParameter optional
Switch parameter to enable email encoding.
-EnableGithubCodeBlocks SwitchParameter optional
Switch parameter to enable GitHub-style code blocks.
-EnableMoreStyling SwitchParameter optional
Switch parameter to enable additional styling options.
-EnableOpenLinksInNewWindow SwitchParameter optional
Switch parameter to open links in a new window.
-EnableRequireSpaceBeforeHeadingText SwitchParameter optional
Switch parameter to require space before heading text.
-EnableSimpleLineBreaks SwitchParameter optional
Switch parameter to enable simple line breaks.
-EnableStrikethrough SwitchParameter optional
Switch parameter to enable strikethrough styling.
-EnableTaskLists SwitchParameter optional
Switch parameter to enable task lists in Markdown.
-EnableTOC SwitchParameter optional
Switch parameter to enable table of contents generation.
-Encoding String optional
Specifies the encoding for reading the Markdown content file. Default is 'UTF8'.
-FilePath String requiredsets: FilePath
Specifies the path to a file containing Markdown content to convert.
-HeaderLevelStart Int32 optional
Specifies the starting header level for Markdown content.
-Id String optional
Specifies the ID attribute for the HTML container.
-omitExtraWLInCodeBlocks SwitchParameter optional
Switch parameter to omit extra whitespace in code blocks.
-SanitezeHTML SwitchParameter optional
Switch parameter to sanitize HTML content.
-ScriptBlock ScriptBlock requiredposition: 0sets: ScriptBlock
Specifies a script block containing Markdown content to convert.
-Content Array requiredsets: Content
Specifies an array of Markdown content to convert.

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.