Project

PSWriteOffice

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

Stars148
Forks14
Open issues0
PowerShell Gallery downloads158661
Releasev1.0.2
Language: C# Updated: 2026-07-05T16:05:48.0000000+00:00

Curated Examples

Read and convert documents

Use PSWriteOffice for Reader, Markdown, CSV, Word conversion, and RTF bridge workflows.

PSWriteOffice is useful after a file already exists. Reader cmdlets inspect documents, Markdown and CSV cmdlets handle scripting-friendly formats, and Word/RTF bridges keep common conversion paths in PowerShell.

This page collects small patterns from the Reader, Markdown, CSV, Word conversion, and RTF examples.

Example

Import-Module PSWriteOffice

$outputDirectory = Join-Path $PSScriptRoot 'Output'
New-Item -ItemType Directory -Path $outputDirectory -Force | Out-Null

$markdownPath = Join-Path $outputDirectory 'Summary.md'
$csvPath = Join-Path $outputDirectory 'Status.csv'
$wordPath = Join-Path $outputDirectory 'Summary.docx'
$rtfPath = Join-Path $outputDirectory 'Summary.rtf'
$roundTripMarkdownPath = Join-Path $outputDirectory 'Summary.from-rtf.md'

New-OfficeMarkdown -Path $markdownPath {
    MarkdownHeading -Level 1 -Text 'Status'
    MarkdownParagraph -Text 'Generated by PSWriteOffice.'
    MarkdownTable -InputObject @(
        [PSCustomObject]@{ Area = 'Docs'; State = 'Ready' }
        [PSCustomObject]@{ Area = 'Examples'; State = 'Review' }
    )
}

@(
    [PSCustomObject]@{ Area = 'Docs'; State = 'Ready' }
    [PSCustomObject]@{ Area = 'Examples'; State = 'Review' }
) | Export-OfficeCsv -Path $csvPath

ConvertFrom-OfficeWordMarkdown -Path $markdownPath -OutputPath $wordPath
ConvertTo-OfficeRtf -MarkdownPath $markdownPath -OutputPath $rtfPath
ConvertFrom-OfficeRtf -Path $rtfPath -As Markdown -OutputPath $roundTripMarkdownPath

Get-OfficeDocumentCapability
Get-OfficeDocumentChunk -Path $wordPath
Get-OfficeDocumentChunk -Path $rtfPath
Import-OfficeCsv -Path $csvPath

What this demonstrates

  • building Markdown and CSV artifacts from PowerShell data
  • converting Markdown to Word, Markdown to RTF, and RTF back to Markdown
  • reading generated files through Reader and format-specific cmdlets

Source