【发布时间】:2021-05-07 10:30:06
【问题描述】:
我正在尝试通过 Powershell 和 Visio 自动创建网络图,但是遇到了障碍。我想改变云的颜色(内置 Visio 形状),但由于某种原因,颜色没有改变。你能帮我解决这个问题吗? (见下面的代码)
Import-Module VisioBot3000 -Force
# Variables
$Username = $env:USERNAME
#set_x = 1
#set_y = 1
#Servers = Read-Host -Prompt "How many routers do you have?
# Opens the Visio application
New-VisioApplication
# Opens the Visio Document
Open-VisioDocument
# Register the network shapes stencil
$PERouterStencil = Register-VisioStencil -Name NetworkSymbols -Path 'C:\Program Files\...\NETSYM_U.vssx'
$VisioStencil2 = Register-VisioStencil -Name NetworkLocations -Path 'C:\Program Files\...\NETLOC_U.vssx'
#Register the router shape
$PE_Router_Shape = Register-VisioShape -Name Router -StencilName Network Symbols -MasterName Router
$Cloud_Register = Register-VisioShape -Name Cloud -StencilName NetworkLocations -MasterName Cloud
#Creating the Cloud
$Cloud = New-VisioShape Cloud -Label Cloud -x 5.6443 -y 4.481
#Width of the Cloud
$Cloud_Width = $Cloud.CellsU('Width').FormulaU = '3 in'
$Cloud_Height = $Cloud.CellsU('Height').FormulaU = '1.89 in'
$Cloud.CellsU('FillForegnd').FormulaForceU = '=RGB(255,0,0)'
$Cloud.CellsU('FillBkgnd').FormulaForceU= 'THEMEGUARD(SHADE(FillForegnd,LUMDIFF(THEME("FillColor"),THEME("FillColor2"))))'
【问题讨论】:
标签: powershell visio