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

Close-OfficePowerPoint

Namespace PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation

Closes a PowerPoint presentation and optionally saves it.

Remarks

Provides a cmdlet wrapper so PowerShell scripts do not need to call Dispose directly.

Examples

Authored help example

Close without saving.

PS>


$ppt = Get-OfficePowerPoint -Path .\deck.pptx; Close-OfficePowerPoint -Presentation $ppt
        

Releases the loaded presentation instance.

Save, open, and close.

PS>


Close-OfficePowerPoint -Presentation $ppt -Save -Open
        

Saves the presentation, opens it in PowerPoint, and releases the object.

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

Close-OfficePowerPoint [-Open] [-Password <String>] [-Path <String>] -Presentation <PowerPointPresentation> [-Save] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Open SwitchParameter optionalposition: namedpipeline: Falsealiases: Show
Open the presentation after saving. Requires -Save or -Path.
Password String optionalposition: namedpipeline: False
Password used to save the presentation as an encrypted package.
Path String optionalposition: namedpipeline: Falsealiases: FilePath
Optional target path when saving.
Presentation PowerPointPresentation requiredposition: namedpipeline: True (ByValue)
Presentation to close.
Save SwitchParameter optionalposition: namedpipeline: False
Persist changes before closing.