Skip to content

Terminate Suspended Messages throws warnings #18

@agentq15

Description

@agentq15

# AssociatedInstances include Routing Failure Reports which have no messages to save $AssociatedInstances = Get-WmiObject MSBTS_ServiceInstance -Namespace 'root\MicrosoftBizTalkServer' -Filter 'ServiceClass=1 or ServiceClass=4 or ServiceClass=64' $ServiceInstances,$AssociatedInstances | ForEach-Object { try { $InstanceId = $_.InstanceId [void]$_.Terminate() Write-Host ("Instance termination [{0}]" -f $InstanceId,$_.Exception.Message) } catch { Write-Host ("##vso[task.logissue type=warning;] Instance termination [{0}] FAILED: {1}" -f $InstanceId,$_.Exception.Message) } }

$ServiceInstances and $AssociatedInstances gets the same messages and both is looped over making it try to Terminate the same messages twice and throws a warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions