Evotec

Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 144
Forks 12
Open issues 16
PowerShell Gallery downloads 150,904
Release v0.2.0
Language: C# Updated: 2026-04-06

API Reference

Cmdlet

New-OfficeMarkdown

Namespace PSWriteOffice
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>] [-NoSave] -OutputPath <String> [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Content ScriptBlock optionalposition: 1pipeline: False
DSL scriptblock describing Markdown content.
NoSave SwitchParameter optionalposition: namedpipeline: False
Skip saving after executing the DSL.
OutputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Destination path for the Markdown file.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for chaining.

Outputs

System.IO.FileInfo OfficeIMO.Markdown.MarkdownDoc