As you can see the picture below. I want to filter descriptor value where subjectkind is group. The azure CLI command I am using to get the descriptor is
az devops security group membership list --id $var1 --org https://dev.azure.com/$OrgName/ --query "*.descriptor" --output tsv
It gives me the output but I am not able to filter the output based on the condition in the JMESPath query to get get the desired output.
FYI: I am using Windows PowerShell ISE
This is not a normal array of dictionary, here you can see the sub properties have same Key value pairs but the top node is different.
C:\Windows\system32> az devops security group membership list --id $var1 --org https://dev.azure.com/$OrgName/
enter code here
{
"aad.MDQwNjg0MDMtOWYwOC03OTM": {
"descriptor": "aad.MDQwNjg0MDMtOWYwOC03OTM",
"directoryAlias": "JoMarie.Jumbo",
"displayName": "Jo Marie Jumbo",
"domain": "78b2bd11",
"legacyDescriptor": null,
"mailAddress": "JoMarie.Jumbo@me.nz",
"metaType": "member",
"origin": "aad",
"originId": "561b354c-527b-48ae",
"principalName": "JoMarie.Jumbo@me.nz",
"subjectKind": "user",
"url": "https://vssps.dev.azure.com/mbie-sandbox/_apis/Graph/Users/aad.MDQwNjg0MDMtOWYwOC03OTM"
},
"aad.ZDJmMzI2ZDItOGM1ZS03NjQyLWExN2": {
"descriptor": "aad.ZDJmMzI2ZDItOGM1ZS03NjQyLWExN2ItOWQ",
"directoryAlias": "Paul.Jumbo",
"displayName": "Paul Jumbo",
"domain": "78b2bd11",
"legacyDescriptor": null,
"mailAddress": "Paul.Jumbo@me.nz",
"origin": "aad",
"originId": "67c2bda2-b9ad-4843",
"principalName": "Paul.Jumbo@me.nz",
"subjectKind": "user",
"url": "https://vssps.dev.azure.com/mbie-sandbox/_apis/Graph/Users/aad.ZDJmMzI2ZDItOGM1ZS03NjQyLWExN"
},
"aad.ZWUwODZlZTQtN2U3MC03M2U0LTk3": {
"descriptor": "aad.ZWUwODZlZTQtN2U3MC03M2U0LTk3",
"directoryAlias": "John.Jumbo",
"displayName": "John Jumbo",
"domain": "78b2bd11",
"legacyDescriptor": null,
"mailAddress": "John.Jumbo@me.nz",
"origin": "aad",
"originId": "7c75ce3a-70a0-40e4",
"principalName": "John.Jumbo@me.nz",
"subjectKind": "user",
"url": "https://vssps.dev.azure.com/mbie-sandbox/_apis/Graph/Users/aad.ZWUwODZlZTQtN2U3MC03M2U0LTk3"
},
