API Reference
Cmdlet
New-OfficeVisio
Creates a new OfficeIMO.Visio document with an initial page and optional DSL content.
Remarks
Creates a new OfficeIMO.Visio document with an initial page and optional DSL content.
Examples
Create a simple service map.
PS>
New-OfficeVisio -Path .\ServiceMap.vsdx -Title 'Service map' -RequestRecalcOnOpen {
VisioRectangle -Key web -Text 'Web' -X 1 -Y 4 -FillColor LightBlue
VisioRectangle -Key api -Text 'API' -X 4 -Y 4 -FillColor LightGreen
VisioConnector -From web -To api -EndArrow Triangle -Label 'calls'
}
Creates an editable .vsdx diagram with two shapes and a connector.
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
New-OfficeVisio [-Author <String>] [-Content <ScriptBlock>] [-Height <Double>] [-NoSave] [-PageName <String>] [-PassThru] -Path <String> [-RequestRecalcOnOpen] [-Show] [-Title <String>] [-Unit <Inches|Centimeters|Millimeters>] [-UseMastersByDefault] [-Width <Double>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- Author String
- Optional document author.
- Content ScriptBlock
- DSL script block describing Visio pages, shapes, and connectors.
- Height Double
- Initial page height.
- NoSave SwitchParameter
- Skip saving and emit the document object.
- PageName String
- Initial page name.
- PassThru SwitchParameter
- Emit the document object instead of the saved file.
- Path String
- Destination .vsdx path.
- RequestRecalcOnOpen SwitchParameter
- Ask Visio to recalculate layout and connector routing when the document opens.
- Show SwitchParameter
- Open the document after saving.
- Title String
- Optional document title.
- Unit VisioMeasurementUnit
- Measurement unit for page width and height.
- Possible values:
Inches,Centimeters,Millimeters - UseMastersByDefault SwitchParameter
- Use Visio masters for supported built-in stencil shapes when saving.
- Width Double
- Initial page width.
Outputs
OfficeIMO.Visio.VisioDocument System.IO.FileInfo