Cmdlet
Update-OfficePowerPointText
Replaces text in a PowerPoint slide or presentation.
Syntax
Update-OfficePowerPointText
[-IncludeNotes]
[-IncludeTables <Boolean>]
-NewValue <String>
-OldValue <String>
[-PassThru]
[<CommonParameters>]#Parameter set:
AutoUpdate-OfficePowerPointText
[-IncludeNotes]
[-IncludeTables <Boolean>]
-NewValue <String>
-OldValue <String>
[-PassThru]
[-Presentation <PowerPointPresentation>]
[<CommonParameters>]#Parameter set:
PresentationUpdate-OfficePowerPointText
[-IncludeNotes]
[-IncludeTables <Boolean>]
-NewValue <String>
-OldValue <String>
[-PassThru]
[-Slide <PowerPointSlide>]
[<CommonParameters>]#Parameter set:
SlideDescription
Can replace text in text boxes, tables, and optionally notes using the OfficeIMO text replacement helpers.
Examples
Replace fiscal year text across the whole deck.
$ppt = New-OfficePowerPoint -Path .\Examples\Documents\PowerPointUpdateText.pptx -NoSave
$slide = Add-OfficePowerPointSlide -Presentation $ppt -Layout 1 -PassThru
Add-OfficePowerPointTextBox -Slide $slide -Text 'FY24 summary'
Set-OfficePowerPointNotes -Slide $slide -Text 'Mention FY24 assumptions.'
$count = Update-OfficePowerPointText -Presentation $ppt -OldValue 'FY24' -NewValue 'FY25' -IncludeNotes -PassThru
$ppt | Close-OfficePowerPoint -SaveReplaces matching text throughout the presentation and notes, returning the replacement count.
Parameters
- -IncludeNotes SwitchParameter
- Include notes text in the replacement operation.
- -IncludeTables Boolean
- Include table cells in the replacement operation.
- -NewValue String
- Replacement text.
- -OldValue String
- Text to find.
- -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Presentation PowerPointPresentation
- Presentation to update.
- -Slide PowerPointSlide
- Slide to update.
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.