Quick start
Last updated
Last updated
Use the Install-Module
cmdlet to install VisioPS from the .
If you are new to PowerShell, run these two commands first. It will assist in debugging your scripts.
The following script introduces several basic concepts.
Here's what's happening in that script:
New-VisioApplication
starts Visio
New-VisioDocument
creates a new Visio document - this document will have one page with no shapes on it
Open-VisioDocument
loads the "Basic Shapes" stencil
Get-VisioMaster
retrieves a the "rectangle" master from the Basic Shapes stencil
The variable $p
is defined to be geometric point built from New-Object VisioAutomation.Geometry.Point(4,5)
New-VisioShape
creates a shape based by "dropping" the "Rectangle" master on the page at the position specified by $points
- the units are always in inches. This shape will be selected once it is drawn.
Set-VisioText
sets the text of the active selection - which will be the shape that was dropped in the previous step