BIZTalk210 powerscript停止并启动SEND PORT

时间:2018-04-05 17:31:57

标签: powershell powershell-v2.0 biztalk biztalk-2010 biztalk-2013

BIZTalk2010 powerscript停止并启动SEND PORT

我的接收位置正常。 BizTalk2010 restart Receive location every hour

现在我需要对发送端口做同样的事情。但它不起作用。

compile group: 'commons-cli', name: 'commons-cli', version: '1.4'

1 个答案:

答案 0 :(得分:1)

解决方案是

function getStatus(){

    foreach ($sendPort in $Catalog.SendPorts | Where {$_.Name -eq $sndLocation })
    {    
        return $sendPort.Status           
    } }

function enablesendLocation(){

    foreach ($sendPort in $Catalog.SendPorts | Where {$_.Name -eq $sndLocation })
    {    
        $sendPort.Status = 3
        $Catalog.SaveChanges()    
        $Catalog.Refresh()
    } }

function disablesendLocation(){

    foreach ($sendPort in $Catalog.SendPorts | Where {$_.Name -eq $sndLocation })
    {    
        $sendPort.Status = 2
        $Catalog.SaveChanges()    
        $Catalog.Refresh()
    } }