Powershell绘制Visio容器

我需要使用powershell绘制visio,但我不知道powershell如何绘制容器。

这是文章 https://powershellstation.com/2016/04/18/powershell-and-visio-part-6-containers/

我已经引用并遵循的

,但是似乎$ master尚未在某处声明,所以它失败了。

我想知道是否有人对此问题有任何说明。

这是我的代码

$Visio=New-Object -ComObject Visio.Application  
$doc=$Visio.Documents.Add(‘’)  
$Page=$Visio.activePage  
$stencilPath=$Visio.GetBuiltInStencilFile(2,0)
$stencil=$Visio.Documents.OpenEx($stencilPath,64)
$page=$Visio.activePage
$container=$page.Drop($master,5,5)
$rec=$page.DrawRectangle(2,3,6)
$container.ContainerProperties.AddMember($rec,1) 

这是错误

You cannot call a method on a null-valued expression.
At line:7 char:1
+ $container.ContainerProperties.AddMember($rec,1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [],RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

我感谢大家的帮助。

z540878734 回答:Powershell绘制Visio容器

这是绘制容器的代码

que = queue.Queue()
get_videos(que)


def get_videos(self,theQue):
        links = input('Enter links comma seperated: ')
        list = links.split(',')
        for i in list:
                theQue.put(i)
        return
本文链接:https://www.f2er.com/2611323.html

大家都在问