Simple Visio Automation from Powershell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Examples Added example with ShapeData Feb 6, 2018
.gitignore added file to gitignore Apr 11, 2016
License.md Added license file Mar 26, 2016
PowerShell And Visio.pptx Updated PowerPoint Apr 7, 2016
README.md Updated readme.md. Fixed #27. May 10, 2016
VisioApplication.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioBasicShapes.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioBot3000.psd1 Updated manifest Jan 15, 2018
VisioBot3000.psm1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioBot3000Aliases.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioBot3000Variables.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioColorFormula.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioConnector.ps1 Added |out-null to many function calls to remove extraneous output. F… May 11, 2016
VisioConstants.ps1 Updated VisioConstants to remove semicolons and to indicate that the … Jan 2, 2018
VisioContainer.ps1 Removed Skip 1 in Container logic. (#74) Jul 2, 2018
VisioDiagramServices.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioDocument.ps1 Added Test-VisioApplication and used it in VisioApplication and Visio… Jan 2, 2018
VisioExport.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioHyperlink.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioLayer.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioPage.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioPositioning.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioSelection.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioSettings.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioShape.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioShapeData.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioStencil.ps1 Split functions out to multiple ps1 files mainly based on noun May 11, 2016
VisioStencilSearchPath.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018
VisioText.ps1 Updates for PSScriptAnalyzer rules Jan 12, 2018

README.md

VisioBot3000

Join the chat at https://gitter.im/MikeShepard/VisioBot3000

Simple Visio Automation from Powershell

A module with some useful function definitions to do diagrams in Visio.

Also exposes a DSL which lets you create diagrams without "scripting".

Primitive Operations

  • New-VisioApplication
  • Get-VisioApplication
  • New-VisioDocument
  • Open-VisioDocument
  • New-VisioPage
  • Set-VisioPage
  • Get-VisioPage
  • Remove-VisioPage
  • New-VisioRectangle
  • Set-VisioPageLayout
  • New-VisioShape
  • New-VisioConnector
  • New-VisioContainer
  • Register-VisioBuiltInStencil
  • Register-VisioStencil
  • Register-VisioShape
  • Register-VisioContainer
  • Register-VisioConnector
  • Get-VisioShape
  • New-VisioHyperLink
  • New-VisioSelection
  • Set-VisioShapeData
  • Get-VisioShapeData
  • Complete-Diagram
  • New-VisioLayer
  • Set-NextShapePosition
  • Get-NextShapePosition
  • Set-RelativePositionDirection
  • Set-VisioText
  • Get-VisioColorFormula
  • Add-StencilSearchPath
  • Set-StencilSearchPath
  • Get-StencilSearchPath

Aliases

  • Diagram (New-VisioDocument)
  • Stencil (Register-VisioStencil)
  • Shape (Register-VisioShape)
  • Container (Register-VisioContainer)
  • Connector (Register-VisioConnector)

Lots of examples in the "Examples" folder

Example using "Primitives"

Import-Module VisioBot3000 -Force

New-VisioApplication

New-VisioDocument C:\temp\TestVisio3.vsdx 
Register-VisioStencil -Name Containers -Path C:\temp\MyContainers.vssx 
Register-VisioStencil -Name Servers -Path C:\temp\SERVER_U.vssx
Register-VisioShape -Name WebServer -From Servers -MasterName 'Web Server'
Register-VisioContainer -Name Location -From Containers -MasterName 'Location'
Register-VisioContainer -Name Domain -From Containers -MasterName 'Domain'
Register-VisioContainer -Name Logical -From Containers -MasterName 'Logical'

New-VisioContainer -shape (Get-VisioShape Logical) -label MyFarm -contents {
    New-VisioContainer -shape (Get-VisioShape Location) -label MyCity -contents {
        New-VisioContainer -shape (Get-VisioShape Domain) -label MyDomain -contents {
            New-VisioShape -master WebServer -label PrimaryServer -x 5 -y 5
        }
    }
    New-VisioContainer -shape (Get-VisioShape Location) -label DRSite -contents {
        New-VisioContainer -shape (Get-VisioShape Domain) -label MyDomain -contents {
            New-VisioShape -master WebServer -label BackupServer -x 5 -y 8
        }
    }
    New-VisioConnector -From PrimaryServer -To BackupServer -Label SQL -Color Red -Arrow
}

Same Example using DSL

Diagram C:\temp\TestVisio3.vsdx 
Stencil Containers -From C:\temp\MyContainers.vssx 
Stencil Servers -From C:\temp\SERVER_U.vssx
Shape WebServer -From Servers -MasterName 'Web Server'
Container Location -From Containers -MasterName 'Location'
Container Domain -From Containers -MasterName 'Domain'
Container Logical -From Containers -MasterName 'Logical'
Connector SQL -Color Red -arrow


Logical MyFarm {
    Location MyCity {
        Domain MyDomain {
            WebServer PrimaryServer 5 5
        }
    }
    Location DRSite {
        Domain MyDomain {
            WebServer BackupServer 5 8
        }
    }
    SQL -From PrimaryServer -To BackupServer
}