【问题标题】:How can you delete a BizTalk receive port with a slash in the name using the PowerShell provider?如何使用 PowerShell 提供程序删除名称中带有斜杠的 BizTalk 接收端口?
【发布时间】:2014-05-30 12:48:25
【问题描述】:

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

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

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

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

试过-LiteralPath,试过单引号

【问题讨论】:

  • 嗯...设置变量的转义字符都不起作用。
  • @boatseller 我最终使用了 ExplorerOM RemoveReceivePort 方法
  • 你应该用你的代码写一个快速的答案并将它标记为接受。
  • @TheMadTechnician Bitmask 打败了我!

标签: powershell biztalk biztalk-ps1-provider


【解决方案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()

【讨论】:

    猜你喜欢
    • 2011-07-31
    • 1970-01-01
    • 2012-05-08
    • 1970-01-01
    • 1970-01-01
    • 2020-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多