Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Add-OfficePowerPointShape

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

Adds a basic shape to a slide.

Syntax

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

Description

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

Examples

Create a rectangle highlight.

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.

Parameters

-FillColor String optional
Fill color (hex or named color).
-Height Double optional
Shape height in points.
-Name String optional
Optional name assigned to the shape.
-OutlineColor String optional
Outline color (hex or named color).
-OutlineWidth Double optional
Outline width in points.
-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-ShapeType OfficePresetShapeType optional
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 optionalpipeline: True (ByValue)
Target slide that will receive the shape (optional inside DSL).
-Width Double optional
Shape width in points.
-X Double optional
Left offset (in points) from the slide origin.
-Y Double optional
Top offset (in points) from the slide origin.

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.