VisioHyperlink.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<# .SYNOPSIS Sets the hyperlink on a shape to the given address. .DESCRIPTION Sets the hyperlink on a shape to the given address. .PARAMETER Shape The shape you want the hyperlink on .PARAMETER Link The address of the hyperlink .INPUTS None. You cannot pipe objects to New-VisioHyperlink. .OUTPUTS None .EXAMPLE New-VisioHyperlink -shape $rectangle -link http://google.com File.txt #> Function New-VisioHyperlink{ [CmdletBinding(SupportsShouldProcess=$True)] Param($Shape, $Link) if($PSCmdlet.ShouldProcess('Visio','Create a hyperlink on a shape')){ $CurrentPage=Get-VisioPage if($Shape -is [string]){ $Shape=$CurrentPage.Shapes[$Shape] } $LinkObject=$Shape.AddHyperLink() $LinkObject.Address=$Link } } |