API Reference

Cmdlet

Remove-OfficePowerPointSlide

Removes a slide by index.

Remarks

Supports -WhatIf/-Confirm thanks to SupportsShouldProcess.

Examples

Authored help example

Example 1: Delete the first slide.

PS>


$ppt = New-OfficePowerPoint -FilePath .\Examples\Documents\PowerPointRemoveSlide.pptx
            Add-OfficePowerPointSlide -Presentation $ppt -Layout 1 | Out-Null
            Add-OfficePowerPointSlide -Presentation $ppt -Layout 1 | Out-Null
            Remove-OfficePowerPointSlide -Presentation $ppt -Index 0 -Confirm:$false
            Save-OfficePowerPoint -Presentation $ppt
        

Removes the first slide and saves the updated deck.

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.

Syntax

Remove-OfficePowerPointSlide -Index <Int32> -Presentation <PowerPointPresentation> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Index Int32 requiredposition: namedpipeline: False
Zero-based slide index.
Presentation PowerPointPresentation requiredposition: namedpipeline: False
Presentation to modify.