# ConvertFrom-OfficeMarkdownHtml

Converts HTML content to Markdown. 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: ConvertFrom-MarkdownHtml

**Module**

`PSWriteOffice`

**Aliases**

`ConvertFrom-MarkdownHtml`

**Inputs**

`System.String`

**Outputs**

`System.String` `System.IO.FileInfo` `OfficeIMO.Markdown.MarkdownDoc`

**Source**

[ConvertFromOfficeMarkdownHtmlCommand.cs:29](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Markdown/ConvertFromOfficeMarkdownHtmlCommand.cs#L29) 

Converts HTML content to Markdown.

## Syntax

```
ConvertFrom-OfficeMarkdownHtml
[-AsDocument]
[-Base64ImageHandling <Include|Skip|SaveToFile>]
[-Base64ImageOutputDirectory <String>]
[-BaseUri <String>]
[-DropUnsupportedBlocks]
[-DropUnsupportedInlineHtml]
[-Html] <String>
[-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>]
[-IncludeDocumentChrome]
[-LineEnding <String>]
[-ListingCardMetadataMode <Preserve|SuppressInRepeatedCards>]
[-MaxInputCharacters <Int32>]
[-MaxTableExpandedColumns <Int32>]
[-Options <HtmlToMarkdownOptions>]
[-OutputPath <String>]
[-PassThru]
[-Portable]
[-PreserveScriptsAndStyles]
[-UnorderedListMarker <String>]
[-WriteOptions <MarkdownWriteOptions>]
[-WriteProfile <OfficeIMO|Portable|HtmlImage>]
[<CommonParameters>]
```

[#](#member-03affcc317d793bd10c3423f)

Parameter set: `Html`

```
ConvertFrom-OfficeMarkdownHtml
[-AsDocument]
[-Base64ImageHandling <Include|Skip|SaveToFile>]
[-Base64ImageOutputDirectory <String>]
[-BaseUri <String>]
[-DropUnsupportedBlocks]
[-DropUnsupportedInlineHtml]
[-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>]
[-IncludeDocumentChrome]
[-LineEnding <String>]
[-ListingCardMetadataMode <Preserve|SuppressInRepeatedCards>]
[-MaxInputCharacters <Int32>]
[-MaxTableExpandedColumns <Int32>]
[-Options <HtmlToMarkdownOptions>]
[-OutputPath <String>]
[-PassThru]
[-Path] <String>
[-Portable]
[-PreserveScriptsAndStyles]
[-UnorderedListMarker <String>]
[-WriteOptions <MarkdownWriteOptions>]
[-WriteProfile <OfficeIMO|Portable|HtmlImage>]
[<CommonParameters>]
```

[#](#member-b11e3fcf878dfe583f9a44db)

Parameter set: `Path`

## Description

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

## Examples

### Convert an HTML fragment to Markdown.

```powershell
$markdown = ConvertFrom-OfficeMarkdownHtml -Html '<h1>Report</h1><p>Ready</p>'
```

Returns Markdown text converted from the supplied HTML.

### Convert an HTML file to a Markdown document object.

```powershell
$doc = ConvertFrom-OfficeMarkdownHtml -Path .\report.html -AsDocument
```

Returns a Markdown document for further editing or rendering.

## Parameters

**-AsDocument SwitchParameter optional**

Emit a Markdown document object instead of Markdown text.

**-Base64ImageHandling HtmlBase64ImageHandling optional**

Controls how base64 data URI images are converted.

Possible values: `Include`, `Skip`, `SaveToFile`

**-Base64ImageOutputDirectory String optional**

Output directory for decoded base64 images when saving them to files.

**-BaseUri String optional**

Base URI used to resolve relative links and image sources.

**-DropUnsupportedBlocks SwitchParameter optional**

Drop unsupported block HTML instead of preserving it as raw HTML.

**-DropUnsupportedInlineHtml SwitchParameter optional**

Drop unsupported inline HTML instead of preserving it as raw HTML.

**-Html String requiredposition: 0pipeline: True (ByValue)sets: Html**

HTML markup to convert.

**-ImageRenderingMode MarkdownImageRenderingMode optional**

Controls how generated Markdown images are serialized.

Possible values: `RichMarkdown`, `PortableMarkdown`, `Html`

**-IncludeDocumentChrome SwitchParameter optional**

Convert the full HTML document instead of only body contents.

**-LineEnding String optional**

Markdown line ending: CRLF, LF, CR, or a literal line ending string.

**-ListingCardMetadataMode HtmlListingCardMetadataMode optional**

Controls whether repeated listing-card metadata is preserved or suppressed.

Possible values: `Preserve`, `SuppressInRepeatedCards`

**-MaxInputCharacters Int32 optional**

Maximum input length, in characters, accepted by the converter.

**-MaxTableExpandedColumns Int32 optional**

Maximum logical columns produced by expanding HTML table spans.

**-Options HtmlToMarkdownOptions optional**

Optional conversion options.

**-OutputPath String optionalaliases: OutPath**

Optional output path for the Markdown file.

**-PassThru SwitchParameter optional**

Emit a FileInfo when saving to disk.

**-Portable SwitchParameter optional**

Use portable Markdown output when Options is not supplied.

**-PreserveScriptsAndStyles SwitchParameter optional**

Preserve script, style, noscript, and template elements.

**-UnorderedListMarker String optional**

Unordered list marker: '-', '*', or '+'.

**-WriteOptions MarkdownWriteOptions optional**

Optional Markdown writer options for generated Markdown text.

**-WriteProfile OfficeMarkdownWriteProfile optional**

Friendly Markdown writer profile for generated Markdown text.

Possible values: `OfficeIMO`, `Portable`, `HtmlImage`

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

Path to an HTML file.

## 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:0E57C6B98E3FD047DA926CC175A9DA07A432605050ECFB4A2DCD82CC58CD641B -->
