Skip to content

Commit 6ba8707

Browse files
author
Mattias Ängehov
committed
example for tenant displayname
1 parent 72a0053 commit 6ba8707

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,25 @@ A complex query on resources featuring field selection, filtering and summarizin
5757

5858
### Example 3
5959
```powershell
60-
PS C:\> Search-AzGraph -Query 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName' -Include DisplayName
60+
PS C:\> Search-AzGraph -Query -Include DisplayName 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName'
6161
6262
name resourceGroup subscriptionDisplayName
6363
---- ------------- -----------------------
6464
ContosoVM RG-Contoso Contoso Production Subscription
6565
6666
```
67-
6867
A query featuring all virtual machines which are not using Managed Disks and includes subscription displayname.
6968

69+
### Example 4
70+
```powershell
71+
PS C:\> Search-AzGraph -Query -Include DisplayName 'summarize count() by tenantDisplayName, subscriptionDisplayName'
72+
73+
tenantDisplayName subscriptionDisplayName count_
74+
----------------- ----------------------- ------
75+
ContosoTenant Contoso Production Subscription 118
76+
```
77+
A query displaying the count of resources by tenant and subscription displayname.
78+
7079
## PARAMETERS
7180

7281
### -DefaultProfile
@@ -138,20 +147,6 @@ Type: System.Int32
138147
Parameter Sets: (All)
139148
Aliases:
140149

141-
Required: False
142-
Position: Named
143-
Default value: None
144-
Accept pipeline input: False
145-
Accept wildcard characters: False
146-
```
147-
### -Include
148-
Set to 'DisplayNames' to add subscriptionDisplayName and tenantDisplayName to the results.
149-
150-
```yaml
151-
Type: System.String
152-
Parameter Sets: (All)
153-
Aliases:
154-
155150
Required: False
156151
Position: Named
157152
Default value: None

0 commit comments

Comments
 (0)