VisioPowerShell
Version 4.5
Version 4.5
  • Introduction
  • Quick start
  • Links
  • Basics
    • Geometry primitves
    • Context-sensitivity
    • Drop shape masters
    • Format shapes with cells
    • Draw basic shapes
    • Create pages
    • Enumerate shapes
    • Bound Visio application
    • Close Visio applications
    • List cmdlets
    • List of all cmdlets
    • Get help for a cmdlet
    • Tips
    • Verbose logging
  • Automatic diagrams
    • Org charts from XML
    • Directed graphs from code
    • Directed graphs from XML
      • Sample Directed Graph XML 1
      • Sample Directed Graph XML 2
      • Sample Directed Graph XML 3
      • Sample Directed Graph XML 4
  • Samples
    • Draw grid
    • Draw fill patterns - slow
    • Draw fill patterns - fast
    • Countdown days
  • Installation
    • Install VisioPS
    • Uninstall VisioPS
    • Detect if VisioPS is installed
  • Technical notes
    • Visio
      • Visio version compatibility
      • Create a new Visio application COM object
    • PowerShell
      • Install PowerShell
      • Detect installed PowerShell version
      • PowerShell version compatibility
      • Use PowerShell 2 with .NET Framework 2.0
    • VisioClient
    • Use VisioAutomation
  • Cmdlets
    • Documents
      • Close-VisioDocument
      • Get-VisioDocument
      • New-VisioDocument
      • Open-VisioDocument
      • Save-VisioDocument
    • Container
    • Custom properties
      • Get-VisioCustomProperty
      • Remove-VisioCustomProperty
      • Set-VisioCustomProperty
      • Examples
    • Hyperlinks
      • Get-VisioHyperlink
      • New-VisioHyperlink
      • Remove-VisioHyperlink
    • Master
      • Get-VisioMaster
    • Pages
      • Copy-VisioPage [TBD]
      • Export-VisioPage
      • Format-VisioPage
      • Get-VisioPage
      • Measure-VisioPage
      • New-VisioPage
      • Remove-VisioPage
      • Select-VisioPage [TBD]
    • PageCells
    • Shapes
      • Connect-VisioShape
      • Copy-VisioShape
      • Export-VisioShape
      • Format-VisioShape
      • Get-VisioShape
      • Join-VisioShape
      • Lock-VisioShape
      • Select-VisioShape
      • Select-VisioShape Invert
      • Select-VisioShape -None
      • Split-VisioShape
      • Test-VisioShape
      • Unlock-VisioShape
      • Examples of Join-VisioShape and Split-VisioShape
    • ShapeCells
      • Set-VisioShapeCells for text
      • Shape cells
    • User-defined cells
      • Get-UserDefinedCell
      • Set-VisioUserDefinedCell
      • Remove-UserDefinedCell
    • Selection
      • Export-VisioSelection
      • Test-VisioSelectedShapes
    • Text
      • Get-VisioText [TBD]
      • Set-VisioText
    • VisioApplication
      • Close-VisioApplication
      • Get-VisioApplication
      • New-VisioApplication
      • Out-VisioApplication
      • Test-VisioApplication
      • Undo-VisioApplication
      • Redo-VisioApplication
    • Windows
      • Format-VisioWindow
  • Developer Info
    • Release history
    • Publis to PowerShell Gallery
    • Debug with Visual Studio
Powered by GitBook
On this page
  • Introduction
  • Overriding context sensitivity
  1. Basics

Context-sensitivity

Introduction

For most VisioPS cmdlets you never need to identify the target of the operation.

For example, the Set-VisioText cmdlet works against the selected shapes in the active document. If no shapes are selected, then nothing happens.

Set-VisioText -Text "Hello World"

The ability for cmdlets to target the appropriate objects based on context dramatically simplifies automating Visio with VisioPS.

Overriding context sensitivity

Sometimes its more convenient to explicitly identify the targets of a cmdlet. Depending on the cmdlet, the following parameters will be available:

  • -Document

  • -Page

  • -Shape

PreviousGeometry primitvesNextDrop shape masters

Last updated 3 years ago