azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

[Doc]: Get-AzAdGroup documentation needs examples for -Filter

Open plmcgrn opened this issue 2 years ago • 2 comments

Description

This doc doesn't include any filter syntax examples, or even what filtering standards should be applied. Like, does it support "like" filters, or only "eq" filters? What syntax standard is expected, OData 3, PowerShell, etc.?

https://docs.microsoft.com/en-us/powershell/module/az.resources/get-azadgroup?view=azps-8.3.0

plmcgrn avatar Sep 14 '22 18:09 plmcgrn

Thanks for reporting. Besides Group, we should provide examples about filter for User, APP as well. In addition, we need to add link below to help user understand more about syntax of filter.

https://docs.microsoft.com/en-us/graph/query-parameters

dingmeng-xue avatar Sep 15 '22 02:09 dingmeng-xue

Thanks to @dingmeng-xue for the link to the higher-level documentation on this param. Agree it should be linked to from any documentation that use the -Filter param.

For those finding this via Google, later on, this worked.

Connect-AzAccount
$filter = "startsWith(DisplayName,'SG_GC')"
$filteredgroups = Get-AzAdGroup -filter $filter

plmcgrn avatar Sep 15 '22 02:09 plmcgrn

docs and examples updated: https://github.com/Azure/azure-powershell/pull/19647

VeryEarly avatar Sep 27 '22 06:09 VeryEarly