Skip to content

Commit d4225bf

Browse files
authored
Merge pull request #10069 from MattiasAng/patch-1
Added -Include parameter with example
2 parents a28b98e + 7dcc3a8 commit d4225bf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/ResourceGraph/ResourceGraph/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
## Version 0.7.6
2323
* Ignoring subscription from azure context
24+
* Add two examples for cmdlet `Search-AzGraph` with parameter `-Include`.
2425

2526
## Version 0.7.5
2627
* Showing warnings in cases when too many subscriptions were used or results got truncated.

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@ westus 26
5555

5656
A complex query on resources featuring field selection, filtering and summarizing.
5757

58+
### Example 3
59+
```powershell
60+
PS C:\> Search-AzGraph -Include DisplayName -Query 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName'
61+
62+
name resourceGroup subscriptionDisplayName
63+
---- ------------- -----------------------
64+
ContosoVM RG-Contoso Contoso Production Subscription
65+
66+
```
67+
A query featuring all virtual machines which are not using Managed Disks and includes subscription display names.
68+
69+
### Example 4
70+
```powershell
71+
PS C:\> Search-AzGraph -Include DisplayName -Query '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 display names.
78+
5879
## PARAMETERS
5980

6081
### -DefaultProfile

0 commit comments

Comments
 (0)