Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Remove-OfficePowerPointSlide

Removes a slide by index.

Remarks

Supports -WhatIf/-Confirm thanks to SupportsShouldProcess.

Examples

Authored help example

Delete the first slide.

PS>


$ppt = New-OfficePowerPoint -Path .\Examples\Documents\PowerPointRemoveSlide.pptx -NoSave
            Add-OfficePowerPointSlide -Presentation $ppt -Layout 1
            Add-OfficePowerPointSlide -Presentation $ppt -Layout 1
            Remove-OfficePowerPointSlide -Presentation $ppt -Index 0 -Confirm:$false
            Close-OfficePowerPoint -Presentation $ppt -Save
        

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> [-PassThru] -Presentation <PowerPointPresentation> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Index Int32 requiredposition: namedpipeline: False
Zero-based slide index.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Presentation PowerPointPresentation requiredposition: namedpipeline: False
Presentation to modify.