# New-OfficeMarkdown

Creates a Markdown document using a DSL scriptblock.

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: MarkdownNew, OfficeMarkdown

**Module**

`PSWriteOffice`

**Aliases**

`MarkdownNew` `OfficeMarkdown`

**Inputs**

`None`

**Outputs**

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

**Source**

[NewOfficeMarkdownCommand.cs:33](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Markdown/NewOfficeMarkdownCommand.cs#L33) 

Creates a Markdown document using a DSL scriptblock.

## Syntax

```
New-OfficeMarkdown
[[-Content] <ScriptBlock>]
[-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>]
[-LineEnding <String>]
[-NoSave]
[-PassThru]
[-Path] <String>
[-UnorderedListMarker <String>]
[-WriteOptions <MarkdownWriteOptions>]
[-WriteProfile <OfficeIMO|Portable|HtmlImage>]
[<CommonParameters>]
```

[#](#method-new-officemarkdown-scriptblock-markdownimagerenderingmode-string-switchparameter-switchparameter-string-string-markdownwriteoptions-officemarkdownwriteprofile)

Parameter set: `All Parameter Sets`

## Description

Runs the scriptblock against a Markdown document and saves it to disk unless -NoSave is specified.

## Examples

### Create a Markdown document with headings and a table.

```powershell
New-OfficeMarkdown -Path .\README.md { MarkdownHeading -Level 1 -Text 'Report'; MarkdownTable -InputObject $data }
```

Creates a README file with a heading and table content.

### Create a report with multiple tables.

```powershell
New-OfficeMarkdown -Path .\Report.md {
  MarkdownHeading -Level 1 -Text 'Summary'
  MarkdownTable -InputObject $summary
  MarkdownHeading -Level 2 -Text 'Details'
  MarkdownTable -InputObject $details
}
```

Creates a report with two tables separated by headings.

## Parameters

**-Content ScriptBlock optionalposition: 1**

DSL scriptblock describing Markdown content.

**-ImageRenderingMode MarkdownImageRenderingMode optional**

Controls how Markdown images are serialized.

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

**-LineEnding String optional**

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

**-NoSave SwitchParameter optional**

Skip saving after executing the DSL.

**-PassThru SwitchParameter optional**

Emit a FileInfo for chaining.

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

Destination path for the Markdown file.

**-UnorderedListMarker String optional**

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

**-WriteOptions MarkdownWriteOptions optional**

Optional Markdown writer options.

**-WriteProfile OfficeMarkdownWriteProfile optional**

Friendly Markdown writer profile.

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

## 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:773787F24A28F3E323C0EF2613799FD57345912A4468AB8568FAE84393C0906D -->
