How can you delete a receive port when the name contains a slash?
I've got a receive port with a slash in its name, e.g. something like ... TestReceivePort/Service
When I try Remove-Item -Path "TestReceivePort/Service"
, I get an error that ...
Remove-Item : Cannot find
path BTS:\Applications\TestApp\Receive Ports\TestReceivePort\Service
Tried -LiteralPath
, tried single quotes
Hopefully this will help:
[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()