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

Close-OfficePowerPoint

Module
PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation

Closes a PowerPoint presentation and optionally saves it.

Syntax

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

Description

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

Examples

Close without saving.

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

Releases the loaded presentation instance.

Save, open, and close.

Close-OfficePowerPoint -Presentation $ppt -Save -Open

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

Parameters

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

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.