Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

New-OfficeMarkdown

Aliases: MarkdownNew, OfficeMarkdown
Namespace PSWriteOffice
Aliases
MarkdownNew OfficeMarkdown
Inputs
None
Outputs
System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc

Creates a Markdown document using a DSL scriptblock.

Remarks

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

Examples

Authored help example

Create a Markdown document with headings and a table.

PS>


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.

PS>


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.

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

New-OfficeMarkdown [-Content <ScriptBlock>] [-ImageRenderingMode <RichMarkdown|PortableMarkdown|Html>] [-LineEnding <String>] [-NoSave] [-PassThru] -Path <String> [-UnorderedListMarker <String>] [-WriteOptions <MarkdownWriteOptions>] [-WriteProfile <OfficeIMO|Portable|HtmlImage>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Content ScriptBlock optionalposition: 1pipeline: False
DSL scriptblock describing Markdown content.
ImageRenderingMode MarkdownImageRenderingMode optionalposition: namedpipeline: Falsevalues: 3
Controls how Markdown images are serialized.
Possible values: RichMarkdown, PortableMarkdown, Html
LineEnding String optionalposition: namedpipeline: False
Markdown line ending: CRLF, LF, CR, or a literal line ending string.
NoSave SwitchParameter optionalposition: namedpipeline: False
Skip saving after executing the DSL.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for chaining.
Path String requiredposition: 0pipeline: Falsealiases: FilePath, OutputPath
Destination path for the Markdown file.
UnorderedListMarker String optionalposition: namedpipeline: False
Unordered list marker: '-', '*', or '+'.
WriteOptions MarkdownWriteOptions optionalposition: namedpipeline: False
Optional Markdown writer options.
WriteProfile OfficeMarkdownWriteProfile optionalposition: namedpipeline: Falsevalues: 3
Friendly Markdown writer profile.
Possible values: OfficeIMO, Portable, HtmlImage

Outputs

System.IO.FileInfo, OfficeIMO.Markdown.MarkdownDoc