# ConvertTo-OfficeMarkdownHtml

Converts Markdown content to HTML. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ConvertTo-MarkdownHtml

**Module**

`PSWriteOffice`

**Aliases**

`ConvertTo-MarkdownHtml`

**Inputs**

`OfficeIMO.Markdown.MarkdownDoc`

**Outputs**

`System.String` `System.IO.FileInfo`

**Source**

[ConvertToOfficeMarkdownHtmlCommand.cs:27](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Markdown/ConvertToOfficeMarkdownHtmlCommand.cs#L27) 

Converts Markdown content to HTML.

## Syntax

```
ConvertTo-OfficeMarkdownHtml
[-AllowDataUrls <Boolean>]
[-AllowedHttpImageHost <String[]>]
[-AllowedHttpLinkHost <String[]>]
[-AllowedUrlScheme <String[]>]
[-AllowMailtoUrls <Boolean>]
[-AllowProtocolRelativeUrls <Boolean>]
[-AssetMode <Online|Offline>]
[-BaseUri <String>]
[-BlockExternalHttpImages]
[-CssDelivery <Inline|ExternalFile|LinkHref>]
[-DisallowFileUrls <Boolean>]
[-DocumentMode]
[-ExternalLinksReferrerPolicy <String>]
[-ExternalLinksRel <String>]
[-ExternalLinksTargetBlank]
[-GitHubFootnoteHtml]
[-GitHubTaskListHtml]
[-ImagesDecodingAsync]
[-ImagesLoadingLazy]
[-ImagesReferrerPolicy <String>]
[-IncludeAnchorLinks]
[-MaxInputCharacters <Int32>]
[-NormalizeInput <IntelligenceXTranscript|IntelligenceXTranscriptStrict|DocsLoose>]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[-Profile <OfficeIMO|CommonMark|GitHubFlavoredMarkdown|Portable>]
[-RawHtmlHandling <Allow|Escape|Sanitize|Strip>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RestrictHttpImagesToBaseOrigin]
[-RestrictHttpLinksToBaseOrigin]
[-RestrictUrlSchemes <Boolean>]
[-Style <HtmlStyle>]
[-Theme <OfficeVisualThemeKind>]
[-Title <String>]
[<CommonParameters>]
```

[#](#member-7331c83e9156230e60b9d671)

Parameter set: `Path`

```
ConvertTo-OfficeMarkdownHtml
[-AllowDataUrls <Boolean>]
[-AllowedHttpImageHost <String[]>]
[-AllowedHttpLinkHost <String[]>]
[-AllowedUrlScheme <String[]>]
[-AllowMailtoUrls <Boolean>]
[-AllowProtocolRelativeUrls <Boolean>]
[-AssetMode <Online|Offline>]
[-BaseUri <String>]
[-BlockExternalHttpImages]
[-CssDelivery <Inline|ExternalFile|LinkHref>]
[-DisallowFileUrls <Boolean>]
[-DocumentMode]
[-ExternalLinksReferrerPolicy <String>]
[-ExternalLinksRel <String>]
[-ExternalLinksTargetBlank]
[-GitHubFootnoteHtml]
[-GitHubTaskListHtml]
[-ImagesDecodingAsync]
[-ImagesLoadingLazy]
[-ImagesReferrerPolicy <String>]
[-IncludeAnchorLinks]
[-MaxInputCharacters <Int32>]
[-NormalizeInput <IntelligenceXTranscript|IntelligenceXTranscriptStrict|DocsLoose>]
[-OutputPath <String>]
[-PassThru]
[-Profile <OfficeIMO|CommonMark|GitHubFlavoredMarkdown|Portable>]
[-RawHtmlHandling <Allow|Escape|Sanitize|Strip>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RestrictHttpImagesToBaseOrigin]
[-RestrictHttpLinksToBaseOrigin]
[-RestrictUrlSchemes <Boolean>]
[-Style <HtmlStyle>]
-Text <String>
[-Theme <OfficeVisualThemeKind>]
[-Title <String>]
[<CommonParameters>]
```

[#](#member-1ca3f2e35fb6b36b89d49f09)

Parameter set: `Text`

```
ConvertTo-OfficeMarkdownHtml
[-AllowDataUrls <Boolean>]
[-AllowedHttpImageHost <String[]>]
[-AllowedHttpLinkHost <String[]>]
[-AllowedUrlScheme <String[]>]
[-AllowMailtoUrls <Boolean>]
[-AllowProtocolRelativeUrls <Boolean>]
[-AssetMode <Online|Offline>]
[-BaseUri <String>]
[-BlockExternalHttpImages]
[-CssDelivery <Inline|ExternalFile|LinkHref>]
[-DisallowFileUrls <Boolean>]
-Document <MarkdownDoc>
[-DocumentMode]
[-ExternalLinksReferrerPolicy <String>]
[-ExternalLinksRel <String>]
[-ExternalLinksTargetBlank]
[-GitHubFootnoteHtml]
[-GitHubTaskListHtml]
[-ImagesDecodingAsync]
[-ImagesLoadingLazy]
[-ImagesReferrerPolicy <String>]
[-IncludeAnchorLinks]
[-MaxInputCharacters <Int32>]
[-NormalizeInput <IntelligenceXTranscript|IntelligenceXTranscriptStrict|DocsLoose>]
[-OutputPath <String>]
[-PassThru]
[-Profile <OfficeIMO|CommonMark|GitHubFlavoredMarkdown|Portable>]
[-RawHtmlHandling <Allow|Escape|Sanitize|Strip>]
[-ReaderOptions <MarkdownReaderOptions>]
[-RestrictHttpImagesToBaseOrigin]
[-RestrictHttpLinksToBaseOrigin]
[-RestrictUrlSchemes <Boolean>]
[-Style <HtmlStyle>]
[-Theme <OfficeVisualThemeKind>]
[-Title <String>]
[<CommonParameters>]
```

[#](#member-92c93ca238455393131eb998)

Parameter set: `Document`

## Description

Returns HTML text or saves it to a file when -OutputPath is specified.

## Examples

### Convert a Markdown file to HTML.

```powershell
$html = ConvertTo-OfficeMarkdownHtml -Path .\README.md
```

Returns the rendered HTML.

### Save a styled HTML document.

```powershell
ConvertTo-OfficeMarkdownHtml -Path .\Report.md -DocumentMode -Title 'Weekly Report' -Style Clean -OutputPath .\Report.html -PassThru
```

Generates a full HTML file with title and CSS styling.

## Parameters

**-AllowDataUrls Boolean optional**

Allow data URLs while parsing Markdown links and images.

**-AllowedHttpImageHost String[] optional**

Allowed HTTP(S) image hosts.

**-AllowedHttpLinkHost String[] optional**

Allowed HTTP(S) link hosts.

**-AllowedUrlScheme String[] optional**

Allowed URL schemes when URL scheme restriction is enabled.

**-AllowMailtoUrls Boolean optional**

Allow mailto URLs while parsing Markdown links.

**-AllowProtocolRelativeUrls Boolean optional**

Allow protocol-relative URLs while parsing Markdown links and images.

**-AssetMode AssetMode optional**

Asset loading mode.

Possible values: `Online`, `Offline`

**-BaseUri String optional**

Base URI used to resolve and restrict relative Markdown links and images.

**-BlockExternalHttpImages SwitchParameter optional**

Block all absolute external HTTP(S) images.

**-CssDelivery CssDelivery optional**

CSS delivery mode.

Possible values: `Inline`, `ExternalFile`, `LinkHref`

**-DisallowFileUrls Boolean optional**

Block file URLs while parsing Markdown links and images.

**-DocumentMode SwitchParameter optional**

Render a full HTML document instead of a fragment.

**-ExternalLinksReferrerPolicy String optional**

referrerpolicy value for external HTTP(S) links.

**-ExternalLinksRel String optional**

rel attribute value for external HTTP(S) links.

**-ExternalLinksTargetBlank SwitchParameter optional**

Open external HTTP(S) links in a new tab.

**-GitHubFootnoteHtml SwitchParameter optional**

Emit GitHub-compatible footnote HTML.

**-GitHubTaskListHtml SwitchParameter optional**

Emit GitHub-compatible task-list HTML.

**-ImagesDecodingAsync SwitchParameter optional**

Add decoding="async" to rendered images.

**-ImagesLoadingLazy SwitchParameter optional**

Add loading="lazy" to rendered images.

**-ImagesReferrerPolicy String optional**

referrerpolicy value for rendered images.

**-IncludeAnchorLinks SwitchParameter optional**

Add anchor links to headings.

**-MaxInputCharacters Int32 optional**

Maximum Markdown input length accepted by the reader.

**-NormalizeInput MarkdownInputNormalizationPreset optional**

Applies a built-in Markdown input normalization preset before parsing.

Possible values: `IntelligenceXTranscript`, `IntelligenceXTranscriptStrict`, `DocsLoose`

**-OutputPath String optionalaliases: OutPath**

Optional output path for the HTML file.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path**

Path to the Markdown file.

**-Profile MarkdownDialectProfile optional**

Named reader profile used when ReaderOptions is not supplied.

Possible values: `OfficeIMO`, `CommonMark`, `GitHubFlavoredMarkdown`, `Portable`

**-RawHtmlHandling RawHtmlHandling optional**

Controls how raw HTML blocks are emitted.

Possible values: `Allow`, `Escape`, `Sanitize`, `Strip`

**-ReaderOptions MarkdownReaderOptions optional**

Optional reader options when parsing Markdown.

**-RestrictHttpImagesToBaseOrigin SwitchParameter optional**

Restrict absolute HTTP(S) images to the base origin.

**-RestrictHttpLinksToBaseOrigin SwitchParameter optional**

Restrict absolute HTTP(S) links to the base origin.

**-RestrictUrlSchemes Boolean optional**

Restrict parsed URL schemes to the allow-list.

**-Style HtmlStyle optional**

Built-in HTML style preset.

Possible values: `Plain`, `Clean`, `GithubLight`, `GithubDark`, `GithubAuto`, `ChatLight`, `ChatDark`, `ChatAuto`, `Word`

**-Theme OfficeVisualThemeKind optional**

Shared Markdown visual theme for HTML output.

Possible values: `Plain`, `WordLike`, `TechnicalDocument`, `GitHubLike`, `Compact`, `Report`

**-Title String optional**

Optional title for HTML documents.

**-Text String requiredsets: Text**

Markdown text to convert.

**-Document MarkdownDoc requiredpipeline: True (ByValue)sets: Document**

Markdown document 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:534AEAEBAD9DD25988BB23281F597EE10C3BC695619875F23C91F7AA7909CBB2 -->
