Cmdlet
Add-OfficePowerPointSlide
Adds a new slide to a PowerPoint presentation.
Syntax
Add-OfficePowerPointSlide
[[-Content] <ScriptBlock>]
[-Layout <Int32>]
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]#Parameter set:
IndexAdd-OfficePowerPointSlide
[-CaseSensitive]
[[-Content] <ScriptBlock>]
-LayoutName <String>
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]#Parameter set:
NameAdd-OfficePowerPointSlide
[[-Content] <ScriptBlock>]
-LayoutType <PowerPointSlideLayoutType>
[-Master <Int32>]
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]#Parameter set:
TypeDescription
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 -SaveCreates 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
- Nested DSL content executed within the slide scope.
- -Layout Int32
- Layout index to use (matches the template’s built-in layouts).
- -Master Int32
- Slide master index to use.
- -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Presentation PowerPointPresentation
- Presentation to update (optional inside New-OfficePowerPoint).
- -CaseSensitive SwitchParameter
- Use case-sensitive matching for layout names.
- -LayoutName String
- Layout name to use (case-insensitive by default).
- -LayoutType PowerPointSlideLayoutType
- 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.