Skip to content

Commit ffbcd9e

Browse files
authored
Merge pull request #360 from msewaweru/issue-357
Corrected the example in the Select parameter section
2 parents e3cb863 + 5422dff commit ffbcd9e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

microsoftgraph/docs-conceptual/use-query-parameters.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Use query parameters to customize PowerShell query outputs"
33
description: "Learn how to use optional query parameters in Microsoft Graph PowerShell SDK to customize the output"
44
ms.topic: conceptual
5-
ms.date: 05/26/2023
5+
ms.date: 08/16/2023
66
author: msewaweru
77
manager: CelesteDG
88
ms.author: eunicewaweru
@@ -20,15 +20,15 @@ Microsoft PowerShell SDK cmdlets may support one or more of the following OData
2020
>[!TIP]
2121
>OData query options in the Microsoft Graph API use lowercase names and specify the dollar ($) prefix while in Microsoft Graph PowerShell SDK, their names are Pascal-cased and prefixed with a hyphen (-). For example, `$count` and `$orderBy` are to Microsoft Graph API while `-Count` and `-OrderBy`, respectively, are to Microsoft Graph PowerShell SDK.
2222
23-
|Name|Description|Example|
24-
|--------|----|-----|
25-
| [-Count](#count-parameter) |Retrieves the total count of matching resources|`Get-MgUser -ConsistencyLevel eventual -Count count`<br>`$count`|
26-
| [-Expand](#expand-parameter)| Retrieves related resources|<code>Get-MgGroup -GroupId '0e06b38f-931a-47db-9a9a-60ab5f492005' -Expand members &#124; Select -ExpandProperty members</code>|
27-
| [-Filter](#filter-parameter)| Filters results (rows)|`Get-MgUser -Filter "startsWith(DisplayName, 'Conf')"`|
28-
| [-OrderBy](#orderby-parameter)| Orders results|`Get-MgUser -OrderBy DisplayName`|
29-
| [-Search](#search-parameter)| Returns results based on search criteria|`Get-MgUser -ConsistencyLevel eventual -Search '"DisplayName:Conf"'`|
30-
| [-Select](#select-parameter)| Filters properties (columns)|<code>Get-MgUser &#124; Select DisplayName, Id</code>|
31-
| [-Top](#top-parameter)| Sets the page size of results. |`Get-MgUser -Top 10`|
23+
|OData query option|Description|Example|
24+
|-----------------|--------|----------|
25+
|[-Count](#count-parameter)|Retrieves the total count of matching resources|`Get-MgUser -ConsistencyLevel eventual -Count count`<br>`$count`|
26+
|[-Expand](#expand-parameter)| Retrieves related resources|<code>Get-MgGroup -GroupId '0e06b38f-931a-47db-9a9a-60ab5f492005' -Expand members &#124; Select -ExpandProperty members</code>|
27+
|[-Filter](#filter-parameter)| Filters results (rows)|`Get-MgUser -Filter "startsWith(DisplayName, 'Conf')"`|
28+
|[-OrderBy](#orderby-parameter)| Orders results|`Get-MgUser -OrderBy DisplayName`|
29+
|[-Search](#search-parameter)| Returns results based on search criteria|`Get-MgUser -ConsistencyLevel eventual -Search '"DisplayName:Conf"'`|
30+
|[-Property](#property-parameter)| Filters properties (columns)|<code>Get-MgUser -Property Id, DisplayName &#124; Select Id, DisplayName</code>|
31+
|[-Top](#top-parameter)| Sets the page size of results. |`Get-MgUser -Top 10`|
3232

3333
## Count parameter
3434

@@ -74,7 +74,7 @@ Id DeletedDateTime
7474
e6d486c1-20f3-426d-bc5d-736c8f467254
7575
```
7676

77-
With some resource collections, you can also specify the properties to be returned in the expanded resources by adding the `-Select` parameter. The following example performs the same query as the previous example but uses a ['Select`](#select-parameter) statement to limit the properties returned for the expanded child items to the **Id** only.
77+
With some resource collections, you can also specify the properties to be returned in the expanded resources by adding the `Select` statement. The following example performs the same query as the previous example but uses a `Select` statement to limit the properties returned for the expanded child items to the **Id** only.
7878

7979
```powershell
8080
Get-MgGroup -GroupId '0e06b38f-931a-47db-9a9a-60ab5f492005' -Expand members |
@@ -161,14 +161,14 @@ Id DisplayName Mail UserPrinci
161161
>[!Note]
162162
>Support for `-Search` varies by module and some properties support `-Search` only in [advanced queries](/graph/aad-advanced-queries?tabs=powershell).
163163
164-
## Select parameter
164+
## Property parameter
165165

166-
Use the `-Select` query parameter to return a set of properties that are different from the default set for an individual resource or a collection of resources. With `-Select`, you can specify a subset or a superset of the default properties.
166+
Use the `-Property` query parameter to return a set of properties that are different from the default set for an individual resource or a collection of resources. With `-Property`, you can specify a subset or a superset of the default properties.
167167

168168
For example, when retrieving a list of all the users, you can specify that only the **Id** and **DisplayName** properties be returned:
169169

170170
```powershell
171-
Get-MgUser | Select Id, DisplayName
171+
Get-MgUser -Property Id, DisplayName | Select Id, DisplayName
172172
```
173173

174174
```Output
@@ -182,9 +182,9 @@ daf80309-1a1f-459d-91b6-7ae5673bc2f2 MOD Administrator
182182
f0735e7b-4ffa-4150-b6a8-7d79e08803cc Bianca Pisani
183183
```
184184

185-
We recommend that you use `-Select` to limit the properties returned by a query to those properties needed by your app. This is especially true of queries that might potentially return a large result set. Limiting the properties returned in each row will reduce network load and help improve your app's performance.
185+
We recommend that you use `-Property` to limit the properties returned by a query to those properties needed by your app. This is especially true of queries that might potentially return a large result set. Limiting the properties returned in each row will reduce network load and help improve your app's performance.
186186

187-
Some Azure AD resources that derive from [DirectoryObject](/graph/api/resources/directoryobject), like [User](/graph/api/resources/user) and [Group](/graph/api/resources/group), return a limited, default subset of properties on reads. For these resources, you must use `-Select` to return properties outside of the default set.
187+
Some Azure AD resources that derive from [DirectoryObject](/graph/api/resources/directoryobject), like [User](/graph/api/resources/user) and [Group](/graph/api/resources/group), return a limited, default subset of properties on reads. For these resources, you must use `-Property` to return properties outside of the default set.
188188

189189
## Top parameter
190190

0 commit comments

Comments
 (0)