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

Review Office documents as HTML

Export Excel workbooks and PowerPoint decks as semantic or visual HTML review artifacts.

Use HTML review output when a workbook or deck needs lightweight inspection without opening the Office application. The semantic profile favors structured content and inventories. The visual profile favors a review snapshot.

Example

Import-Module PSWriteOffice

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

$workbookPath = Join-Path $outputDirectory 'ServiceReview.xlsx'
$deckPath = Join-Path $outputDirectory 'ServiceReview.pptx'

$rows = @(
    [PSCustomObject]@{ Service = 'Identity'; Status = 'Healthy'; Owner = 'Platform' }
    [PSCustomObject]@{ Service = 'Messaging'; Status = 'Watch'; Owner = 'Collaboration' }
)

New-OfficeExcel -Path $workbookPath {
    Add-OfficeExcelSheet -Name 'Services' -Content {
        Set-OfficeExcelRow -Row 1 -Values 'Service', 'Status', 'Owner'
        Add-OfficeExcelTable -Data $rows -TableName 'Services' -TableStyle 'TableStyleMedium4'
        Set-OfficeExcelColumn -Column 1, 2, 3 -AutoFit
    }
} -PassThru | Out-Null

$deck = New-OfficePowerPoint -FilePath $deckPath
$slide = Add-OfficePowerPointSlide -Presentation $deck -Layout 1
Set-OfficePowerPointSlideTitle -Slide $slide -Title 'Service Review' | Out-Null
Add-OfficePowerPointTextBox -Slide $slide -Text 'Review the service status before the weekly meeting.' -X 80 -Y 140 -Width 560 -Height 80 | Out-Null
Save-OfficePowerPoint -Presentation $deck
$deck.Dispose()

ConvertTo-OfficeExcelHtml -Path $workbookPath -OutputPath (Join-Path $outputDirectory 'ServiceReview.workbook.html') -Title 'Workbook Review'
ConvertTo-OfficePowerPointHtml -Path $deckPath -Profile VisualReview -OutputPath (Join-Path $outputDirectory 'ServiceReview.deck.visual.html') -Title 'Deck Review'

What this demonstrates

  • creating real Excel and PowerPoint files first
  • exporting workbook content as HTML through ConvertTo-OfficeExcelHtml
  • exporting deck review output through ConvertTo-OfficePowerPointHtml
  • using the visual profile when layout review matters more than raw text

Source