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-OfficeVisioContainer

Aliases: VisioContainer
Namespace PSWriteOffice
Aliases
VisioContainer
Inputs
System.Object
Outputs
OfficeIMO.Visio.VisioShape

Creates an OfficeIMO-authored Visio-native container around existing shapes.

Remarks

Creates an OfficeIMO-authored Visio-native container around existing shapes.

Examples

Authored help example

Group related shapes in a container.

PS>


OfficeVisio -Path .\Architecture.vsdx {
                VisioRectangle -Key api -Text 'API' -X 2 -Y 4
                VisioRectangle -Key worker -Text 'Worker' -X 4 -Y 4
                VisioContainer -Id app -Text 'Application tier' -ShapeId api,worker -FillColor '#F8FAFC'
            }
        

Creates a native Visio container around previously keyed shapes.

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-OfficeVisioContainer [-ContainerStyle <Int32>] [-FillColor <String>] [-HeadingHeight <Double>] [-HeadingStyle <Int32>] -Id <String> [-InputObject <Object>] [-LineColor <String>] [-LineWeight <Double>] [-Locked] [-Margin <Double>] [-NoAutoResize] [-NoHighlight] [-NoRibbon] [-Page <VisioPage>] [-PassThru] [-ShapeId <String[]>] [-Text <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

ContainerStyle Int32 optionalposition: namedpipeline: False
Native Visio container gallery identifier. Zero selects the default/no explicit gallery style.
FillColor String optionalposition: namedpipeline: False
Container fill color.
HeadingHeight Double optionalposition: namedpipeline: False
Additional heading height in page units.
HeadingStyle Int32 optionalposition: namedpipeline: False
Native Visio heading gallery identifier. Zero disables the heading style.
Id String requiredposition: namedpipeline: False
Container shape identifier.
InputObject Object optionalposition: 0pipeline: True (ByValue)
Shapes, shape selections, or shape keys/ids to include in the container.
LineColor String optionalposition: namedpipeline: False
Container line color.
LineWeight Double optionalposition: namedpipeline: False
Container line weight in inches.
Locked SwitchParameter optionalposition: namedpipeline: False
Lock the generated container.
Margin Double optionalposition: namedpipeline: False
Outer margin around member shapes in page units.
NoAutoResize SwitchParameter optionalposition: namedpipeline: False
Disable Visio container auto resize metadata.
NoHighlight SwitchParameter optionalposition: namedpipeline: False
Suppress Visio selection highlighting metadata.
NoRibbon SwitchParameter optionalposition: namedpipeline: False
Suppress Visio container ribbon metadata.
Page VisioPage optionalposition: namedpipeline: False
Page that owns the member shapes. Optional inside OfficeVisio/VisioPage DSL scopes.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
ShapeId String[] optionalposition: namedpipeline: False
Shape keys or ids to include in the container.
Text String optionalposition: namedpipeline: False
Container heading text.

Outputs

OfficeIMO.Visio.VisioShape