Summary
In the RDSessionDeployment class-based resource (source/Classes/020.RDSessionDeployment.ps1), the GetCurrentState() method currently determines the ConnectionBroker value by filtering the results of Get-RDServer for the RDS-CONNECTION-BROKER role:
ConnectionBroker = ($deployed.Where({ $_.Roles -contains 'RDS-CONNECTION-BROKER' })).Server
However, if Get-RDServer returns results (i.e. a deployment exists), the ConnectionBroker should simply be set to $properties.ConnectionBroker — since the query was already scoped to that broker and a successful response confirms it is present.
In HA deployments, filtering for RDS-CONNECTION-BROKER could also return multiple values, which would be incompatible with the [System.String] type of the ConnectionBroker property.
Expected Behaviour
When Get-RDServer returns results, ConnectionBroker in the returned hashtable should be set to $properties.ConnectionBroker.
Backlinks
Raised by @dan-hughes.