Cmdlet
Close-OfficePowerPoint
Closes a PowerPoint presentation and optionally saves it.
Syntax
Close-OfficePowerPoint [-Open] [-Password <String>] [-Path <String>] -Presentation <PowerPointPresentation> [-Save] [<CommonParameters>]#Parameter set:
All Parameter SetsDescription
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 $pptReleases the loaded presentation instance.
Save, open, and close.
Close-OfficePowerPoint -Presentation $ppt -Save -OpenSaves the presentation, opens it in PowerPoint, and releases the object.
Parameters
- -Open SwitchParameter
- Open the presentation after saving. Requires -Save or -Path.
- -Password String
- Password used to save the presentation as an encrypted package.
- -Path String
- Optional target path when saving.
- -Presentation PowerPointPresentation
- Presentation to close.
- -Save SwitchParameter
- 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.