API Reference

Cmdlet

Close-OfficePowerPoint

Namespace PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation
Outputs
System.Object

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 -FilePath .\deck.pptx; Close-OfficePowerPoint -Presentation $ppt
        

Releases the loaded presentation instance.

Save, open, and close.

PS>


Close-OfficePowerPoint -Presentation $ppt -Save -Show
        

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 [-Password <String>] -Presentation <PowerPointPresentation> [-Save] [-Show] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Password String optionalposition: namedpipeline: False
Password used to save the presentation as an encrypted package.
Presentation PowerPointPresentation requiredposition: namedpipeline: True (ByValue)
Presentation to close.
Save SwitchParameter optionalposition: namedpipeline: False
Persist changes before closing.
Show SwitchParameter optionalposition: namedpipeline: False
Open the presentation in PowerPoint after saving.

Outputs

System.Object