Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Add-OfficePowerPointSlide

Aliases: PptSlide
Module
PSWriteOffice
Aliases
PptSlide
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation

Adds a new slide to a PowerPoint presentation.

Syntax

Add-OfficePowerPointSlide
[[-Content] <ScriptBlock>]
[-Layout <Int32>]
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]
#
Parameter set: Index
Add-OfficePowerPointSlide
[-CaseSensitive]
[[-Content] <ScriptBlock>]
-LayoutName <String>
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]
#
Parameter set: Name
Add-OfficePowerPointSlide
[[-Content] <ScriptBlock>]
-LayoutType <PowerPointSlideLayoutType>
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]
#
Parameter set: Type

Description

Creates a slide using OfficeIMO master/layout indexes and can execute nested DSL content.

Examples

Append a slide with the default layout.

$ppt = New-OfficePowerPoint -Path .\deck.pptx -NoSave
Add-OfficePowerPointSlide -Presentation $ppt
$ppt | Close-OfficePowerPoint -Save

Creates a deck and appends a new slide at the end.

Create a slide using the DSL.

New-OfficePowerPoint -Path .\deck.pptx { PptSlide { PptTitle -Title 'Status Update' } }

Creates a slide and sets the title using DSL aliases.

Parameters

-Content ScriptBlock optionalposition: 0
Nested DSL content executed within the slide scope.
-Layout Int32 optionalsets: Index
Layout index to use (matches the template’s built-in layouts).
-Master Int32 optional
Slide master index to use.
-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-Presentation PowerPointPresentation optionalpipeline: True (ByValue)
Presentation to update (optional inside New-OfficePowerPoint).
-CaseSensitive SwitchParameter optionalsets: Name
Use case-sensitive matching for layout names.
-LayoutName String requiredsets: Name
Layout name to use (case-insensitive by default).
-LayoutType PowerPointSlideLayoutType requiredsets: Type
Layout type to use.
Possible values: Title, Text, TwoColumnText, Table, TextAndChart, ChartAndText, Diagram, Chart, TextAndClipArt, ClipArtAndText, TitleOnly, Blank, TextAndObject, ObjectAndText, ObjectOnly, Object, TextAndMedia, MediaAndText, ObjectOverText, TextOverObject, TextAndTwoObjects, TwoObjectsAndText, TwoObjectsOverText, FourObjects, VerticalText, ClipArtAndVerticalText, VerticalTitleAndText, VerticalTitleAndTextOverChart, TwoObjects, ObjectAndTwoObjects, TwoObjectsAndObject, Custom, SectionHeader, TwoTextAndTwoObjects, ObjectText, PictureText

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.