Hi KanakAgrawal-6035,
You may find the Get-ClusterGroup command more useful, although you may need to identify each role individually in order to get the devices with those roles. please see:
I hope this answers your question.
--------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--