# Create a Visio diagram

Create a Visio diagram on Evotec with practical examples, usage guidance, and reusable project workflows.

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)

Stars**723**

Forks**84**

Open issues**2**

PowerShell Gallery downloads**5217154**

Release**v3.6.2**

Language: C# Updated: 2026-11-23

Curated Examples

Use PSWriteOffice to create a Visio diagram with stencils, connectors, and exported previews.

This pattern is useful when a script needs to generate an editable `.vsdx` diagram and preview images for review.

It is adapted from `Examples/Visio/Example-Visio-StencilFlow.ps1`.

## Example

```powershell
Import-Module PSWriteOffice

$outputDirectory = Join-Path $PSScriptRoot 'Output'
$null = New-Item -ItemType Directory -Path $outputDirectory -Force
$visioPath = Join-Path $outputDirectory 'OnboardingFlow.vsdx'
$svgPath = Join-Path $outputDirectory 'OnboardingFlow.svg'
$pngPath = Join-Path $outputDirectory 'OnboardingFlow.png'

New-OfficeVisio -Path $visioPath -Title 'Customer onboarding flow' -UseMastersByDefault -RequestRecalcOnOpen {
    Import-OfficeVisioStencil -BuiltIn Flowchart -Name Flow -Default

    VisioStencil -Catalog Flow -Stencil process -Key intake -Text 'Intake' -X 1.5 -Y 4
    VisioStencil -Catalog Flow -Stencil decision -Key review -Text 'Review?' -X 4 -Y 4
    VisioStencil -Catalog Flow -Stencil data -Key archive -Text 'Archive' -X 6.5 -Y 4
    VisioConnector -From intake -To review -Kind RightAngle -EndArrow Triangle -Label 'submit'
    VisioConnector -From review -To archive -Kind RightAngle -EndArrow Triangle -Label 'store'
}

Get-OfficeVisioInfo -Path $visioPath -AsText
ConvertTo-OfficeVisioSvg -Path $visioPath -OutputPath $svgPath
ConvertTo-OfficeVisioPng -Path $visioPath -OutputPath $pngPath
```

## What this demonstrates

- creating editable Visio diagrams without automating desktop Visio
- using built-in stencils and connectors
- exporting SVG and PNG previews from the same `.vsdx`

## Source

- [Example-Visio-StencilFlow.ps1](https://github.com/EvotecIT/PSWriteOffice/blob/main/Examples/Visio/Example-Visio-StencilFlow.ps1)

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