API Reference
Find-OfficePowerPointShape
Finds PowerPoint shapes by text, name, kind, or slide.
Remarks
Searches an open presentation or a single slide and returns PowerPointShapeInfo records that include the slide index, shape index, shape kind, extracted text, shape name, and the underlying OfficeIMO shape object. Text matching includes normal text boxes and table cell text, so this command can locate the right object before piping it into modification commands. Use -Text for literal contains matching or -Pattern for regular expressions, or omit both text parameters when -Kind, -Name, -Index, and -ShapeIndex identify the target shape without reading text content.
Examples
Find and update a text box.
PS>
Find-OfficePowerPointShape -Presentation $ppt -Text 'FY24' -Kind TextBox |
Set-OfficePowerPointShapeText -Text 'FY25'
Finds matching text shapes and updates them without using the PowerPoint DSL.
Find a table by cell text and append a new status row.
PS>
$ppt = Get-OfficePowerPoint -Path .\Readiness.pptx
$table = Find-OfficePowerPointShape -Presentation $ppt -Text 'Risk' -Kind Table | Select-Object -First 1
$table | Add-OfficePowerPointTableRow -Values 'Latency', 'Investigating'
$ppt | Close-OfficePowerPoint -Save
Uses table-cell text as the locator, then pipes the table shape metadata into a table-row edit.
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
Find-OfficePowerPointShape [-CaseSensitive] [-Index <Nullable`1>] [-Kind <TextBox>] [-Name <String[]>] -Presentation <PowerPointPresentation> [-ShapeIndex <Int32[]>] [-Text <String>] [<CommonParameters>]#PresentationTextParameters
- CaseSensitive SwitchParameter
- Use case-sensitive matching for text and name filters.
- Index Nullable`1
- Optional zero-based slide index when reading from a presentation.
- Kind String[]
- Optional shape kind filter such as TextBox or Table.
- Possible values:
TextBox,Picture,Table,Chart,AutoShape,GroupShape - Name String[]
- Optional wildcard filter for shape names.
- Presentation PowerPointPresentation
- Open presentation whose slides should be searched.
- ShapeIndex Int32[]
- Optional zero-based shape index filter, useful when several shapes contain the same text.
- Text String
- Literal text to find in text boxes and table cells.
Outputs
PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo: PowerShell-friendly description of a PowerPoint shape.
Find-OfficePowerPointShape [-CaseSensitive] [-Index <Nullable`1>] [-Kind <TextBox>] [-Name <String[]>] -Pattern <String> -Presentation <PowerPointPresentation> [-ShapeIndex <Int32[]>] [<CommonParameters>]#PresentationRegexParameters
- CaseSensitive SwitchParameter
- Use case-sensitive matching for text and name filters.
- Index Nullable`1
- Optional zero-based slide index when reading from a presentation.
- Kind String[]
- Optional shape kind filter such as TextBox or Table.
- Possible values:
TextBox,Picture,Table,Chart,AutoShape,GroupShape - Name String[]
- Optional wildcard filter for shape names.
- Pattern String
- Regular expression to find in text boxes and table cells.
- Presentation PowerPointPresentation
- Open presentation whose slides should be searched.
- ShapeIndex Int32[]
- Optional zero-based shape index filter, useful when several shapes contain the same text.
Outputs
PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo: PowerShell-friendly description of a PowerPoint shape.
Find-OfficePowerPointShape [-CaseSensitive] [-Kind <TextBox>] [-Name <String[]>] [-ShapeIndex <Int32[]>] -Slide <PowerPointSlide> [-Text <String>] [<CommonParameters>]#SlideTextParameters
- CaseSensitive SwitchParameter
- Use case-sensitive matching for text and name filters.
- Kind String[]
- Optional shape kind filter such as TextBox or Table.
- Possible values:
TextBox,Picture,Table,Chart,AutoShape,GroupShape - Name String[]
- Optional wildcard filter for shape names.
- ShapeIndex Int32[]
- Optional zero-based shape index filter, useful when several shapes contain the same text.
- Slide PowerPointSlide
- Single slide to search when the caller has already resolved the slide.
- Text String
- Literal text to find in text boxes and table cells.
Outputs
PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo: PowerShell-friendly description of a PowerPoint shape.
Find-OfficePowerPointShape [-CaseSensitive] [-Kind <TextBox>] [-Name <String[]>] -Pattern <String> [-ShapeIndex <Int32[]>] -Slide <PowerPointSlide> [<CommonParameters>]#SlideRegexParameters
- CaseSensitive SwitchParameter
- Use case-sensitive matching for text and name filters.
- Kind String[]
- Optional shape kind filter such as TextBox or Table.
- Possible values:
TextBox,Picture,Table,Chart,AutoShape,GroupShape - Name String[]
- Optional wildcard filter for shape names.
- Pattern String
- Regular expression to find in text boxes and table cells.
- ShapeIndex Int32[]
- Optional zero-based shape index filter, useful when several shapes contain the same text.
- Slide PowerPointSlide
- Single slide to search when the caller has already resolved the slide.
Outputs
PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo: PowerShell-friendly description of a PowerPoint shape.