PowerPoint Cmdlets
Edit on GitHubPSWriteOffice cmdlets and DSL aliases for building PowerPoint presentations from PowerShell.
PowerPoint Cmdlets
PSWriteOffice exposes OfficeIMO.PowerPoint through both direct cmdlets and lightweight DSL aliases. The examples below favor the direct cmdlets because they map cleanly to the generated help surface.
Core workflow
- Create a presentation with
New-OfficePowerPoint. - Add slides, text boxes, bullets, images, tables, or charts.
- Save the presentation as part of your script or pipeline output.
Quick start
$ppt = New-OfficePowerPoint -FilePath .\status_update.pptx
$slide = Add-OfficePowerPointSlide -Presentation $ppt
Add-OfficePowerPointTextBox -Slide $slide -Text 'Weekly Status' -X 80 -Y 60 -Width 520 -Height 50
Add-OfficePowerPointBullets -Slide $slide -Bullets @(
'Shipped the March release',
'Closed 14 customer issues',
'Finished security review follow up'
) -X 80 -Y 140 -Width 520 -Height 220
$ppt | Save-OfficePowerPointCmdlet-style slide composition
$ppt = New-OfficePowerPoint -FilePath .\deck.pptx
$slide = Add-OfficePowerPointSlide -Presentation $ppt
Add-OfficePowerPointTextBox -Slide $slide -Text 'Quarterly Overview' -X 80 -Y 60 -Width 500 -Height 50
Add-OfficePowerPointBullets -Slide $slide -Bullets @(
'Revenue grew 18%',
'New onboarding flow launched',
'Support backlog dropped below target'
) -X 80 -Y 150 -Width 520 -Height 220
Add-OfficePowerPointImage -Slide $slide -Path .\logo.png -X 560 -Y 40 -Width 120 -Height 72
$ppt | Save-OfficePowerPointData-heavy slides
When your source is tabular data, use the table and chart cmdlets instead of manually building text shapes:
$ppt = New-OfficePowerPoint -FilePath .\quarterly_review.pptx
$rows = @(
[pscustomobject]@{ Product = 'Alpha'; Q1 = 12; Q2 = 15; Q3 = 18; Q4 = 20 }
[pscustomobject]@{ Product = 'Beta'; Q1 = 9; Q2 = 11; Q3 = 13; Q4 = 14 }
[pscustomobject]@{ Product = 'Gamma'; Q1 = 6; Q2 = 9; Q3 = 12; Q4 = 16 }
)
$slide = Add-OfficePowerPointSlide -Presentation $ppt
Add-OfficePowerPointTable -Slide $slide -Data $rows -X 60 -Y 140 -Width 420 -Height 200
$ppt | Save-OfficePowerPointUseful commands
New-OfficePowerPointcreates a presentation and can host the DSL block.Add-OfficePowerPointSlideadds new slides when you want explicit control.Add-OfficePowerPointTextBoxandAdd-OfficePowerPointBulletscover most narrative slide content.Add-OfficePowerPointTable,Add-OfficePowerPointChart, andAdd-OfficePowerPointImageare the main building blocks for report decks.Add-OfficePowerPointSectionhelps organize larger presentations into named sections.Save-OfficePowerPointpersists the generated deck to disk.
Related guides
- PSWriteOffice overview -- Module-level installation and command map.
- PowerPoint overview -- .NET package workflow and layout concepts.
- PowerPoint product page -- Install command and package positioning.