PSWriteOffice is a cross-platform PowerShell module for creating and reading Microsoft Office documents (Word, Excel, PowerPoint - experimental), plus Markdown and CSV, powered by OfficeIMO.*.
It provides verb-noun cmdlets and a scriptblock-first DSL while OfficeIMO owns the core engine and tests.
This module is built using following libraries:
- Open XML SDK for .NET licensed MIT - Microsoft's library doing heavy lifting for all other Open XML projects.
- OfficeIMO.Word.Html - OfficeIMO HTML converters for Word.
- OfficeIMO - core engines: Word, Excel, PowerPoint, Markdown, CSV.
- SixLabors.ImageSharp licensed Apache 2.0 - library for image processing.
HTML converters (OfficeIMO.Word.Html):
ConvertTo-OfficeWordHtml -Path .\report.docx -OutputPath .\report.htmlConvertFrom-OfficeWordHtml -Path .\snippet.html -OutputPath .\report.docx
CSV helpers:
Get-OfficeCsv -Path .\data.csvGet-OfficeCsvData -Path .\data.csvConvertTo-OfficeCsv -OutputPath .\export.csv
Markdown helpers:
Get-OfficeMarkdown -Path .\README.mdConvertTo-OfficeMarkdown(from objects)ConvertTo-OfficeMarkdownHtml -Text $md -DocumentMode
Word DSL quick start:
New-OfficeWord -Path .\Report.docx { WordSection { WordParagraph 'Hello' } }Get-OfficeWordParagraph -Path .\Report.docx | Select-Object -First 3
Excel DSL quick start:
New-OfficeExcel -Path .\Report.xlsx { ExcelSheet 'Data' { Set-OfficeExcelRow -Row 1 -Values 'Name','Value' } }Get-OfficeExcelNamedRange -Path .\Report.xlsx