API Reference
Cmdlet
Close-OfficePowerPoint
Closes a PowerPoint presentation and optionally saves it.
Remarks
Provides a cmdlet wrapper so PowerShell scripts do not need to call Dispose directly.
Examples
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 SetsParameters
- 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.