Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Add-OfficePowerPointShape

Aliases: PptShape
Namespace PSWriteOffice
Aliases
PptShape
Inputs
OfficeIMO.PowerPoint.PowerPointSlide

Adds a basic shape to a slide.

Remarks

Creates an auto shape at the requested coordinates and applies optional fill and outline styling.

Examples

Authored help example

Create a rectangle highlight.

PS>


New-OfficePowerPoint -Path .\Examples\Documents\PowerPointShape.pptx {
                $slide = Add-OfficePowerPointSlide -Layout 1 -PassThru
                Add-OfficePowerPointShape -Slide $slide -ShapeType Rectangle -X 60 -Y 120 -Width 220 -Height 90 -FillColor '#DDEEFF' -OutlineColor '#2563EB' -OutlineWidth 1
                Add-OfficePowerPointTextBox -Slide $slide -Text 'Highlighted status' -X 80 -Y 145 -Width 180 -Height 32
            }
        

Creates a styled rectangle and overlays a text box.

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

Add-OfficePowerPointShape [-FillColor <String>] [-Height <Double>] [-Name <String>] [-OutlineColor <String>] [-OutlineWidth <Double>] [-PassThru] [-ShapeType <Line>] [-Slide <PowerPointSlide>] [-Width <Double>] [-X <Double>] [-Y <Double>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

FillColor String optionalposition: namedpipeline: False
Fill color (hex or named color).
Height Double optionalposition: namedpipeline: False
Shape height in points.
Name String optionalposition: namedpipeline: False
Optional name assigned to the shape.
OutlineColor String optionalposition: namedpipeline: False
Outline color (hex or named color).
OutlineWidth Double optionalposition: namedpipeline: False
Outline width in points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
ShapeType OfficePresetShapeType optionalposition: namedpipeline: Falsevalues: 187
Shape geometry preset name (e.g., Rectangle, Ellipse, Line).
Possible values: Line, LineInverse, Triangle, RightTriangle, Rectangle, Diamond, Parallelogram, Trapezoid, NonIsoscelesTrapezoid, Pentagon, Hexagon, Heptagon, Octagon, Decagon, Dodecagon, Star4, Star5, Star6, Star7, Star8, Star10, Star12, Star16, Star24, Star32, RoundRectangle, Round1Rectangle, Round2SameRectangle, Round2DiagonalRectangle, SnipRoundRectangle, Snip1Rectangle, Snip2SameRectangle, Snip2DiagonalRectangle, Plaque, Ellipse, Teardrop, HomePlate, Chevron, PieWedge, Pie, BlockArc, Donut, NoSmoking, RightArrow, LeftArrow, UpArrow, DownArrow, StripedRightArrow, NotchedRightArrow, BentUpArrow, LeftRightArrow, UpDownArrow, LeftUpArrow, LeftRightUpArrow, QuadArrow, LeftArrowCallout, RightArrowCallout, UpArrowCallout, DownArrowCallout, LeftRightArrowCallout, UpDownArrowCallout, QuadArrowCallout, BentArrow, UTurnArrow, CircularArrow, LeftCircularArrow, LeftRightCircularArrow, CurvedRightArrow, CurvedLeftArrow, CurvedUpArrow, CurvedDownArrow, SwooshArrow, Cube, Can, LightningBolt, Heart, Sun, Moon, SmileyFace, IrregularSeal1, IrregularSeal2, FoldedCorner, Bevel, Frame, HalfFrame, Corner, DiagonalStripe, Chord, Arc, LeftBracket, RightBracket, LeftBrace, RightBrace, BracketPair, BracePair, StraightConnector1, BentConnector2, BentConnector3, BentConnector4, BentConnector5, CurvedConnector2, CurvedConnector3, CurvedConnector4, CurvedConnector5, Callout1, Callout2, Callout3, AccentCallout1, AccentCallout2, AccentCallout3, BorderCallout1, BorderCallout2, BorderCallout3, AccentBorderCallout1, AccentBorderCallout2, AccentBorderCallout3, WedgeRectangleCallout, WedgeRoundRectangleCallout, WedgeEllipseCallout, CloudCallout, Cloud, Ribbon, Ribbon2, EllipseRibbon, EllipseRibbon2, LeftRightRibbon, VerticalScroll, HorizontalScroll, Wave, DoubleWave, Plus, FlowChartProcess, FlowChartDecision, FlowChartInputOutput, FlowChartPredefinedProcess, FlowChartInternalStorage, FlowChartDocument, FlowChartMultidocument, FlowChartTerminator, FlowChartPreparation, FlowChartManualInput, FlowChartManualOperation, FlowChartConnector, FlowChartPunchedCard, FlowChartPunchedTape, FlowChartSummingJunction, FlowChartOr, FlowChartCollate, FlowChartSort, FlowChartExtract, FlowChartMerge, FlowChartOfflineStorage, FlowChartOnlineStorage, FlowChartMagneticTape, FlowChartMagneticDisk, FlowChartMagneticDrum, FlowChartDisplay, FlowChartDelay, FlowChartAlternateProcess, FlowChartOffpageConnector, ActionButtonBlank, ActionButtonHome, ActionButtonHelp, ActionButtonInformation, ActionButtonForwardNext, ActionButtonBackPrevious, ActionButtonEnd, ActionButtonBeginning, ActionButtonReturn, ActionButtonDocument, ActionButtonSound, ActionButtonMovie, Gear6, Gear9, Funnel, MathPlus, MathMinus, MathMultiply, MathDivide, MathEqual, MathNotEqual, CornerTabs, SquareTabs, PlaqueTabs, ChartX, ChartStar, ChartPlus
Slide PowerPointSlide optionalposition: namedpipeline: True (ByValue)
Target slide that will receive the shape (optional inside DSL).
Width Double optionalposition: namedpipeline: False
Shape width in points.
X Double optionalposition: namedpipeline: False
Left offset (in points) from the slide origin.
Y Double optionalposition: namedpipeline: False
Top offset (in points) from the slide origin.