0

当名称包含斜杠时,如何删除接收端口?

我有一个名称中带有斜杠的接收端口,例如... TestReceivePort/Service

当我尝试Remove-Item -Path "TestReceivePort/Service"时,我收到一个错误...

Remove-Item : Cannot find 
              path BTS:\Applications\TestApp\Receive Ports\TestReceivePort\Service

试过了-LiteralPath,试过单引号

4

1 回答 1

1

希望这会有所帮助:

[void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")
$server = "."
$connectionString = "SERVER=" + $server + ";DATABASE=BizTalkMgmtDb;Integrated Security=SSPI"
$Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
$Catalog.ConnectionString = $connectionString
$rcvLocation =  $Catalog.ReceivePorts | Where {$_.Name = 'rcvLocation/withSlash'}
$Catalog.RemoveReceivePort($rcvLocation)
$Catalog.SaveChanges()
于 2014-06-02T19:37:57.900 回答