API Reference

Cmdlet

Find-OfficePowerPointShape

Namespace PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation OfficeIMO.PowerPoint.PowerPointSlide
Outputs
PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo

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

Authored help example

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>]
#
Parameter set: PresentationText

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and name filters.
Index Nullable`1 optionalposition: namedpipeline: False
Optional zero-based slide index when reading from a presentation.
Kind String[] optionalposition: namedpipeline: Falsevalues: 6
Optional shape kind filter such as TextBox or Table.
Possible values: TextBox, Picture, Table, Chart, AutoShape, GroupShape
Name String[] optionalposition: namedpipeline: False
Optional wildcard filter for shape names.
Presentation PowerPointPresentation requiredposition: namedpipeline: True (ByValue)
Open presentation whose slides should be searched.
ShapeIndex Int32[] optionalposition: namedpipeline: False
Optional zero-based shape index filter, useful when several shapes contain the same text.
Text String optionalposition: 0pipeline: False
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>]
#
Parameter set: PresentationRegex

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and name filters.
Index Nullable`1 optionalposition: namedpipeline: False
Optional zero-based slide index when reading from a presentation.
Kind String[] optionalposition: namedpipeline: Falsevalues: 6
Optional shape kind filter such as TextBox or Table.
Possible values: TextBox, Picture, Table, Chart, AutoShape, GroupShape
Name String[] optionalposition: namedpipeline: False
Optional wildcard filter for shape names.
Pattern String requiredposition: 0pipeline: False
Regular expression to find in text boxes and table cells.
Presentation PowerPointPresentation requiredposition: namedpipeline: True (ByValue)
Open presentation whose slides should be searched.
ShapeIndex Int32[] optionalposition: namedpipeline: False
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>]
#
Parameter set: SlideText

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and name filters.
Kind String[] optionalposition: namedpipeline: Falsevalues: 6
Optional shape kind filter such as TextBox or Table.
Possible values: TextBox, Picture, Table, Chart, AutoShape, GroupShape
Name String[] optionalposition: namedpipeline: False
Optional wildcard filter for shape names.
ShapeIndex Int32[] optionalposition: namedpipeline: False
Optional zero-based shape index filter, useful when several shapes contain the same text.
Slide PowerPointSlide requiredposition: namedpipeline: True (ByValue)
Single slide to search when the caller has already resolved the slide.
Text String optionalposition: 0pipeline: False
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>]
#
Parameter set: SlideRegex

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for text and name filters.
Kind String[] optionalposition: namedpipeline: Falsevalues: 6
Optional shape kind filter such as TextBox or Table.
Possible values: TextBox, Picture, Table, Chart, AutoShape, GroupShape
Name String[] optionalposition: namedpipeline: False
Optional wildcard filter for shape names.
Pattern String requiredposition: 0pipeline: False
Regular expression to find in text boxes and table cells.
ShapeIndex Int32[] optionalposition: namedpipeline: False
Optional zero-based shape index filter, useful when several shapes contain the same text.
Slide PowerPointSlide requiredposition: namedpipeline: True (ByValue)
Single slide to search when the caller has already resolved the slide.

Outputs

PSWriteOffice.Services.PowerPoint.PowerPointShapeInfo: PowerShell-friendly description of a PowerPoint shape.