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
  • Nudge shapes
  • Aligning shapes
  • Distributing shapes along an axis
  1. Cmdlets
  2. Shapes

Format-VisioShape

The Format-VisioShape cmdlet allows you to control how shapes are laid out on the page.

Nudge shapes

# nudge shape 1 inch right
Format-VisioShape -NudgeX 1

# nudge shape 1 inch left
Format-VisioShape -NudgeX -1

# nudge shape 1 inch up
Format-VisioShape -NudgeX 1

# nudge shape 1 inch down
Format-VisioShape -Nudge

Aligning shapes

# Align shapes vertically
Format-VisioShape -AlignVertical Top
Format-VisioShape -AlignVertical Center
Format-VisioShape -AlignVertical Bottom

# Align shapes horizontally
Format-VisioShape -AlignHorizontal Left
Format-VisioShape -AlignHorizontal Center
Format-VisioShape -AlignHorizontal Right

# Align shapes horizontally and vertically at the same time
Format-VisioShape -AlignHorizontal Left -AlignVertical Bottom

Distributing shapes along an axis

# Evenly along the x-axis
Format-VisioShape -DistributeHorizontal 

# Evenly along the y axis
Format-VisioShape -DistributeVertical

PreviousExport-VisioShapeNextGet-VisioShape

Last updated 5 years ago