Find RDM session by ID including Sub Connection

Find RDM session by ID including Sub Connection

avatar

Hello,
I need to find RDM session by ID - no matter if it is Connection or SubConnection.
I'm using code like this:

$rdmSession = Get-RDMSession | Where-Object { $_.ID -eq $RDMGuid }


But, this does not include SubConnection.

  1. Is there any way how to get all Sessions(Connections) including SubSession(SubConnections) ?
  2. Is there any way how to read only one session with concrete ID and not all session and then filter out it using | ?


Thank you for any idea.

Ivo

All Comments (3)

avatar

Hi Ivo,

Sub connections are stored in the SubConnections array inside your session.
They can be accessed like so

$rdmSession = Get-RDMSession | Where-Object { $_.ID -eq $RDMGuid }
$rdmSession.SubConnections


I don't think there is any way right now. We could add a -ID parameter to the Get-RDMSession command, but it would essentially do exactly what Where-Object is doing, only internally.

I hope this helps, let me know if it doesn't

Regards

Jonathan Lafontaine

avatar

Hi Jonathan,

thank you for quick answer.
I know about $rdmSession.SubConnections.
Of course I can handle it by some PS code, but using something like

$rdmSession = Get-RDMSession -ID '12132154-4654645-45545' -IncludeSubConnection
$rdmAllSessions = Get-RDMSession -IncludeSubConnection

would be more elegant...

Thank you.

Best regards,

Ivo

avatar

That's is an idea we can explore.

Jonathan Lafontaine