PSWriteOffice

Edit on GitHub

Overview of the PSWriteOffice PowerShell module for Word, Excel, PowerPoint, and Markdown automation.

PSWriteOffice

PSWriteOffice is the PowerShell surface for the OfficeIMO ecosystem. It brings document generation and automation to scripts, build agents, scheduled jobs, and admin tooling without requiring Microsoft Office to be installed.

What it covers

  • Word document creation and editing for reports, runbooks, and generated business documents.
  • Excel workbook generation for exports, inventory reports, dashboards, and structured data handoffs.
  • PowerPoint presentation automation for status decks, reviews, and generated slides.
  • Markdown document generation for READMEs, reports, release notes, and developer-facing content.

Installation

Install from the PowerShell Gallery:

Install-Module -Name PSWriteOffice -Scope CurrentUser

For all users (requires Administrator):

Install-Module -Name PSWriteOffice -Scope AllUsers

Update to the latest version:

Update-Module -Name PSWriteOffice

Key Cmdlets

Word Cmdlets

CmdletDescription
New-OfficeWordCreate a new Word document
Get-OfficeWordOpen an existing Word document
Save-OfficeWordSave the document to disk
Close-OfficeWordClose and dispose the document
Add-OfficeWordSectionAdd a new section
Add-OfficeWordParagraphAdd a paragraph
Add-OfficeWordTextAdd formatted inline text to a paragraph
Add-OfficeWordTableRender object data as a table
Add-OfficeWordImageAdd an image
Add-OfficeWordHeaderAdd header content
Add-OfficeWordFooterAdd footer content

Excel Cmdlets

CmdletDescription
New-OfficeExcelCreate a new Excel workbook
Get-OfficeExcelOpen an existing workbook
Save-OfficeExcelSave the workbook
Close-OfficeExcelClose and dispose the workbook
Add-OfficeExcelSheetAdd a worksheet
Set-OfficeExcelCellWrite values or formulas to a cell
Add-OfficeExcelTableAdd a table to a worksheet

PowerPoint Cmdlets

CmdletDescription
New-OfficePowerPointCreate a new presentation
Add-OfficePowerPointSlideAdd a slide to the presentation
Add-OfficePowerPointTextBoxInsert positioned text boxes
Add-OfficePowerPointBulletsAdd bulleted content to a slide
Add-OfficePowerPointTableRender tabular data in a slide
Add-OfficePowerPointChartAdd charts from series data
Add-OfficePowerPointImagePlace images on a slide
Add-OfficePowerPointSectionGroup slides into named sections
Save-OfficePowerPointPersist the generated deck

Markdown Cmdlets

CmdletDescription
New-OfficeMarkdownCreate a new Markdown document
Add-OfficeMarkdownHeadingAdd headings to a document
Add-OfficeMarkdownParagraphAdd body paragraphs
Add-OfficeMarkdownTableRender object data as a Markdown table
Add-OfficeMarkdownCodeAdd fenced code blocks
Add-OfficeMarkdownCalloutAdd note, warning, or tip callouts
Add-OfficeMarkdownTaskListAdd GitHub-style task lists
Add-OfficeMarkdownTableOfContentsGenerate a TOC from headings

Quick Example

Import-Module PSWriteOffice

$doc = New-OfficeWord -Path "C:\Reports\Monthly.docx" -PassThru

$doc | Add-OfficeWordParagraph -Text "Monthly Status Report" -Style Heading1
$doc | Add-OfficeWordParagraph -Text "Generated on $(Get-Date -Format 'yyyy-MM-dd')"
$doc | Add-OfficeWordParagraph {
    Add-OfficeWordText -Text "All systems operational." -Bold
}

$doc | Save-OfficeWord
Close-OfficeWord -Document $doc

Pipeline Support

The document object flows through the pipeline, which makes simple composition concise:

$doc = New-OfficeWord -Path "pipeline.docx" -PassThru

$doc |
    Add-OfficeWordParagraph -Text "Title" -Style Heading1 |
    Add-OfficeWordParagraph {
        Add-OfficeWordText -Text "Subtitle" -Italic
    } |
    Add-OfficeWordParagraph -Text "Chapter 1 content" |
    Save-OfficeWord

Close-OfficeWord -Document $doc

Discovering Available Commands

List all PSWriteOffice cmdlets:

Get-Command -Module PSWriteOffice

Get help for a specific cmdlet:

Get-Help New-OfficeWord -Full
Get-Help Add-OfficeWordParagraph -Examples

Further Reading