API Reference
Cmdlet
ConvertTo-OfficeMarkdownHtml
Converts Markdown content to HTML.
Remarks
Returns HTML text or saves it to a file when -OutputPath is specified.
Examples
Example 1: Convert a Markdown file to HTML.
PS>
$html = ConvertTo-OfficeMarkdownHtml -Path .\README.md
Returns the rendered HTML.
Example 2: Save a styled HTML document.
PS>
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.
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
ConvertTo-OfficeMarkdownHtml [-AllowDataUrls <Nullable`1>] [-AllowedHttpImageHost <String[]>] [-AllowedHttpLinkHost <String[]>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-AssetMode <Online|Offline>] [-BaseUri <String>] [-BlockExternalHttpImages] [-CssDelivery <Inline|ExternalFile|LinkHref>] [-DisallowFileUrls <Nullable`1>] [-DocumentMode] [-ExternalLinksReferrerPolicy <String>] [-ExternalLinksRel <String>] [-ExternalLinksTargetBlank] [-GitHubFootnoteHtml] [-GitHubTaskListHtml] [-ImagesDecodingAsync] [-ImagesLoadingLazy] [-ImagesReferrerPolicy <String>] [-IncludeAnchorLinks] -InputPath <String> [-MaxInputCharacters <Nullable`1>] [-NormalizeInput <Nullable`1>] [-OutputPath <String>] [-PassThru] [-Profile <Nullable`1>] [-RawHtmlHandling <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RestrictHttpImagesToBaseOrigin] [-RestrictHttpLinksToBaseOrigin] [-RestrictUrlSchemes <Nullable`1>] [-Style <Plain>] [-Theme <Nullable`1>] [-Title <String>] [<CommonParameters>]#Parameter set:
PathParameters
- AllowDataUrls Nullable`1
- Allow data URLs while parsing Markdown links and images.
- AllowedHttpImageHost String[]
- Allowed HTTP(S) image hosts.
- AllowedHttpLinkHost String[]
- Allowed HTTP(S) link hosts.
- AllowedUrlScheme String[]
- Allowed URL schemes when URL scheme restriction is enabled.
- AllowMailtoUrls Nullable`1
- Allow mailto URLs while parsing Markdown links.
- AllowProtocolRelativeUrls Nullable`1
- Allow protocol-relative URLs while parsing Markdown links and images.
- AssetMode AssetMode
- Asset loading mode. Possible values: Online, Offline
- Possible values:
Online,Offline - BaseUri String
- Base URI used to resolve and restrict relative Markdown links and images.
- BlockExternalHttpImages SwitchParameter
- Block all absolute external HTTP(S) images.
- CssDelivery CssDelivery
- CSS delivery mode. Possible values: Inline, ExternalFile, LinkHref, None
- Possible values:
Inline,ExternalFile,LinkHref - DisallowFileUrls Nullable`1
- Block file URLs while parsing Markdown links and images.
- DocumentMode SwitchParameter
- Render a full HTML document instead of a fragment.
- ExternalLinksReferrerPolicy String
- referrerpolicy value for external HTTP(S) links.
- ExternalLinksRel String
- rel attribute value for external HTTP(S) links.
- ExternalLinksTargetBlank SwitchParameter
- Open external HTTP(S) links in a new tab.
- GitHubFootnoteHtml SwitchParameter
- Emit GitHub-compatible footnote HTML.
- GitHubTaskListHtml SwitchParameter
- Emit GitHub-compatible task-list HTML.
- ImagesDecodingAsync SwitchParameter
- Add decoding="async" to rendered images.
- ImagesLoadingLazy SwitchParameter
- Add loading="lazy" to rendered images.
- ImagesReferrerPolicy String
- referrerpolicy value for rendered images.
- IncludeAnchorLinks SwitchParameter
- Add anchor links to headings.
- InputPath String
- Path to the Markdown file.
- MaxInputCharacters Nullable`1
- Maximum Markdown input length accepted by the reader.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
- OutputPath String
- Optional output path for the HTML file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- Profile Nullable`1
- Named reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
- RawHtmlHandling Nullable`1
- Controls how raw HTML blocks are emitted. Possible values: Allow, Escape, Sanitize, Strip
- ReaderOptions MarkdownReaderOptions
- Optional reader options when parsing Markdown.
- RestrictHttpImagesToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) images to the base origin.
- RestrictHttpLinksToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) links to the base origin.
- RestrictUrlSchemes Nullable`1
- Restrict parsed URL schemes to the allow-list.
- Style HtmlStyle
- Built-in HTML style preset. Possible values: Plain, Clean, GithubLight, GithubDark, GithubAuto, ChatLight, ChatDark, ChatAuto, Word
- Possible values:
Plain,Clean,GithubLight,GithubDark,GithubAuto,ChatLight,ChatDark,ChatAuto,Word - Theme Nullable`1
- Shared Markdown visual theme for HTML output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
- Title String
- Optional title for HTML documents.
Outputs
System.IO.FileInfo, System.String
ConvertTo-OfficeMarkdownHtml [-AllowDataUrls <Nullable`1>] [-AllowedHttpImageHost <String[]>] [-AllowedHttpLinkHost <String[]>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-AssetMode <Online|Offline>] [-BaseUri <String>] [-BlockExternalHttpImages] [-CssDelivery <Inline|ExternalFile|LinkHref>] [-DisallowFileUrls <Nullable`1>] [-DocumentMode] [-ExternalLinksReferrerPolicy <String>] [-ExternalLinksRel <String>] [-ExternalLinksTargetBlank] [-GitHubFootnoteHtml] [-GitHubTaskListHtml] [-ImagesDecodingAsync] [-ImagesLoadingLazy] [-ImagesReferrerPolicy <String>] [-IncludeAnchorLinks] [-MaxInputCharacters <Nullable`1>] [-NormalizeInput <Nullable`1>] [-OutputPath <String>] [-PassThru] [-Profile <Nullable`1>] [-RawHtmlHandling <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RestrictHttpImagesToBaseOrigin] [-RestrictHttpLinksToBaseOrigin] [-RestrictUrlSchemes <Nullable`1>] [-Style <Plain>] -Text <String> [-Theme <Nullable`1>] [-Title <String>] [<CommonParameters>]#Parameter set:
TextParameters
- AllowDataUrls Nullable`1
- Allow data URLs while parsing Markdown links and images.
- AllowedHttpImageHost String[]
- Allowed HTTP(S) image hosts.
- AllowedHttpLinkHost String[]
- Allowed HTTP(S) link hosts.
- AllowedUrlScheme String[]
- Allowed URL schemes when URL scheme restriction is enabled.
- AllowMailtoUrls Nullable`1
- Allow mailto URLs while parsing Markdown links.
- AllowProtocolRelativeUrls Nullable`1
- Allow protocol-relative URLs while parsing Markdown links and images.
- AssetMode AssetMode
- Asset loading mode. Possible values: Online, Offline
- Possible values:
Online,Offline - BaseUri String
- Base URI used to resolve and restrict relative Markdown links and images.
- BlockExternalHttpImages SwitchParameter
- Block all absolute external HTTP(S) images.
- CssDelivery CssDelivery
- CSS delivery mode. Possible values: Inline, ExternalFile, LinkHref, None
- Possible values:
Inline,ExternalFile,LinkHref - DisallowFileUrls Nullable`1
- Block file URLs while parsing Markdown links and images.
- DocumentMode SwitchParameter
- Render a full HTML document instead of a fragment.
- ExternalLinksReferrerPolicy String
- referrerpolicy value for external HTTP(S) links.
- ExternalLinksRel String
- rel attribute value for external HTTP(S) links.
- ExternalLinksTargetBlank SwitchParameter
- Open external HTTP(S) links in a new tab.
- GitHubFootnoteHtml SwitchParameter
- Emit GitHub-compatible footnote HTML.
- GitHubTaskListHtml SwitchParameter
- Emit GitHub-compatible task-list HTML.
- ImagesDecodingAsync SwitchParameter
- Add decoding="async" to rendered images.
- ImagesLoadingLazy SwitchParameter
- Add loading="lazy" to rendered images.
- ImagesReferrerPolicy String
- referrerpolicy value for rendered images.
- IncludeAnchorLinks SwitchParameter
- Add anchor links to headings.
- MaxInputCharacters Nullable`1
- Maximum Markdown input length accepted by the reader.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
- OutputPath String
- Optional output path for the HTML file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- Profile Nullable`1
- Named reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
- RawHtmlHandling Nullable`1
- Controls how raw HTML blocks are emitted. Possible values: Allow, Escape, Sanitize, Strip
- ReaderOptions MarkdownReaderOptions
- Optional reader options when parsing Markdown.
- RestrictHttpImagesToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) images to the base origin.
- RestrictHttpLinksToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) links to the base origin.
- RestrictUrlSchemes Nullable`1
- Restrict parsed URL schemes to the allow-list.
- Style HtmlStyle
- Built-in HTML style preset. Possible values: Plain, Clean, GithubLight, GithubDark, GithubAuto, ChatLight, ChatDark, ChatAuto, Word
- Possible values:
Plain,Clean,GithubLight,GithubDark,GithubAuto,ChatLight,ChatDark,ChatAuto,Word - Text String
- Markdown text to convert.
- Theme Nullable`1
- Shared Markdown visual theme for HTML output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
- Title String
- Optional title for HTML documents.
Outputs
System.IO.FileInfo, System.String
ConvertTo-OfficeMarkdownHtml [-AllowDataUrls <Nullable`1>] [-AllowedHttpImageHost <String[]>] [-AllowedHttpLinkHost <String[]>] [-AllowedUrlScheme <String[]>] [-AllowMailtoUrls <Nullable`1>] [-AllowProtocolRelativeUrls <Nullable`1>] [-AssetMode <Online|Offline>] [-BaseUri <String>] [-BlockExternalHttpImages] [-CssDelivery <Inline|ExternalFile|LinkHref>] [-DisallowFileUrls <Nullable`1>] -Document <MarkdownDoc> [-DocumentMode] [-ExternalLinksReferrerPolicy <String>] [-ExternalLinksRel <String>] [-ExternalLinksTargetBlank] [-GitHubFootnoteHtml] [-GitHubTaskListHtml] [-ImagesDecodingAsync] [-ImagesLoadingLazy] [-ImagesReferrerPolicy <String>] [-IncludeAnchorLinks] [-MaxInputCharacters <Nullable`1>] [-NormalizeInput <Nullable`1>] [-OutputPath <String>] [-PassThru] [-Profile <Nullable`1>] [-RawHtmlHandling <Nullable`1>] [-ReaderOptions <MarkdownReaderOptions>] [-RestrictHttpImagesToBaseOrigin] [-RestrictHttpLinksToBaseOrigin] [-RestrictUrlSchemes <Nullable`1>] [-Style <Plain>] [-Theme <Nullable`1>] [-Title <String>] [<CommonParameters>]#Parameter set:
DocumentParameters
- AllowDataUrls Nullable`1
- Allow data URLs while parsing Markdown links and images.
- AllowedHttpImageHost String[]
- Allowed HTTP(S) image hosts.
- AllowedHttpLinkHost String[]
- Allowed HTTP(S) link hosts.
- AllowedUrlScheme String[]
- Allowed URL schemes when URL scheme restriction is enabled.
- AllowMailtoUrls Nullable`1
- Allow mailto URLs while parsing Markdown links.
- AllowProtocolRelativeUrls Nullable`1
- Allow protocol-relative URLs while parsing Markdown links and images.
- AssetMode AssetMode
- Asset loading mode. Possible values: Online, Offline
- Possible values:
Online,Offline - BaseUri String
- Base URI used to resolve and restrict relative Markdown links and images.
- BlockExternalHttpImages SwitchParameter
- Block all absolute external HTTP(S) images.
- CssDelivery CssDelivery
- CSS delivery mode. Possible values: Inline, ExternalFile, LinkHref, None
- Possible values:
Inline,ExternalFile,LinkHref - DisallowFileUrls Nullable`1
- Block file URLs while parsing Markdown links and images.
- Document MarkdownDoc
- Markdown document to convert.
- DocumentMode SwitchParameter
- Render a full HTML document instead of a fragment.
- ExternalLinksReferrerPolicy String
- referrerpolicy value for external HTTP(S) links.
- ExternalLinksRel String
- rel attribute value for external HTTP(S) links.
- ExternalLinksTargetBlank SwitchParameter
- Open external HTTP(S) links in a new tab.
- GitHubFootnoteHtml SwitchParameter
- Emit GitHub-compatible footnote HTML.
- GitHubTaskListHtml SwitchParameter
- Emit GitHub-compatible task-list HTML.
- ImagesDecodingAsync SwitchParameter
- Add decoding="async" to rendered images.
- ImagesLoadingLazy SwitchParameter
- Add loading="lazy" to rendered images.
- ImagesReferrerPolicy String
- referrerpolicy value for rendered images.
- IncludeAnchorLinks SwitchParameter
- Add anchor links to headings.
- MaxInputCharacters Nullable`1
- Maximum Markdown input length accepted by the reader.
- NormalizeInput Nullable`1
- Applies a built-in Markdown input normalization preset before parsing. Possible values: None, IntelligenceXTranscript, IntelligenceXTranscriptStrict, DocsLoose
- OutputPath String
- Optional output path for the HTML file.
- PassThru SwitchParameter
- Emit a FileInfo when saving to disk.
- Profile Nullable`1
- Named reader profile used when ReaderOptions is not supplied. Possible values: OfficeIMO, CommonMark, GitHubFlavoredMarkdown, Portable
- RawHtmlHandling Nullable`1
- Controls how raw HTML blocks are emitted. Possible values: Allow, Escape, Sanitize, Strip
- ReaderOptions MarkdownReaderOptions
- Optional reader options when parsing Markdown.
- RestrictHttpImagesToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) images to the base origin.
- RestrictHttpLinksToBaseOrigin SwitchParameter
- Restrict absolute HTTP(S) links to the base origin.
- RestrictUrlSchemes Nullable`1
- Restrict parsed URL schemes to the allow-list.
- Style HtmlStyle
- Built-in HTML style preset. Possible values: Plain, Clean, GithubLight, GithubDark, GithubAuto, ChatLight, ChatDark, ChatAuto, Word
- Possible values:
Plain,Clean,GithubLight,GithubDark,GithubAuto,ChatLight,ChatDark,ChatAuto,Word - Theme Nullable`1
- Shared Markdown visual theme for HTML output. Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
- Title String
- Optional title for HTML documents.
Outputs
System.IO.FileInfo, System.String