I'm trying to exclude a few properties from Azure's CLI Output. I know I can use --query
to filter through the output using its JMESPath. But I want to exclude just one of them, so it doesn't make sense to select all the other using --query
.
Is there a way to do this? I'm looking for something similar to what PowerShell can do:
Select-Object -Property * -ExcludeProperty
The following example illustrates one particular case.
Sample Command: az ad group list -o json
Output:
[
{
"deletionTimestamp": null,
"description": "app_description",
"dirSyncEnabled": null,
"displayName": "name",
"lastDirSyncTime": null,
"mail": "sample@domain.com",
"mailEnabled": true,
"mailNickname": "sampleMail",
"objectId": "xxxxxx-xxxx-xxxxxxxx-xxxxx",
"objectType": null,
"onPremisesDomainName": null,
"onPremisesNetBiosName": null,
"onPremisesSamAccountName": null,
"onPremisesSecurityIdentifier": null,
"provisioningErrors": [],
"proxyAddresses": [],
"securityEnabled": false
}
]
Expected Output: Same as above, but without the description
and objectId
properties.