# New-OfficeVisio

Creates a new OfficeIMO.Visio document with an initial page and optional DSL content.

Project

PSWriteOffice

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

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: OfficeVisio, VisioNew

**Module**

`PSWriteOffice`

**Aliases**

`OfficeVisio` `VisioNew`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Visio.VisioDocument` `System.IO.FileInfo`

**Source**

[NewOfficeVisioCommand.cs:23](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Visio/NewOfficeVisioCommand.cs#L23) 

Creates a new OfficeIMO.Visio document with an initial page and optional DSL content.

## Syntax

```
New-OfficeVisio
[-Author <String>]
[[-Content] <ScriptBlock>]
[-Height <Double>]
[-NoSave]
[-Open]
[-PageName <String>]
[-PassThru]
[-Path] <String>
[-RequestRecalcOnOpen]
[-Title <String>]
[-Unit <Inches|Centimeters|Millimeters>]
[-UseMastersByDefault]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-new-officevisio-string-scriptblock-double-switchparameter-switchparameter-string-switchparameter-string-switchparameter-string-visiomeasurementunit-switchparameter-double)

Parameter set: `All Parameter Sets`

## Examples

### Create a simple service map.

```powershell
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.

## Parameters

**-Author String optional**

Optional document author.

**-Content ScriptBlock optionalposition: 1**

DSL script block describing Visio pages, shapes, and connectors.

**-Height Double optional**

Initial page height.

**-NoSave SwitchParameter optional**

Skip saving and emit the document object.

**-Open SwitchParameter optionalaliases: Show**

Open the document after saving.

**-PageName String optional**

Initial page name.

**-PassThru SwitchParameter optional**

Emit the document object instead of the saved file.

**-Path String requiredposition: 0aliases: FilePath**

Destination .vsdx path.

**-RequestRecalcOnOpen SwitchParameter optional**

Ask Visio to recalculate layout and connector routing when the document opens.

**-Title String optional**

Optional document title.

**-Unit VisioMeasurementUnit optional**

Measurement unit for page width and height.

Possible values: `Inches`, `Centimeters`, `Millimeters`

**-UseMastersByDefault SwitchParameter optional**

Use Visio masters for supported built-in stencil shapes when saving.

**-Width Double optional**

Initial page width.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:BA423F9E7C3CF20BBB391B2763F5CA0AAB9BC34B93BD3117DF493237BBC848AF -->
