diff --git a/src/ResourceGraph/ResourceGraph/ChangeLog.md b/src/ResourceGraph/ResourceGraph/ChangeLog.md index 247a93c0be10..7c91c26a816c 100644 --- a/src/ResourceGraph/ResourceGraph/ChangeLog.md +++ b/src/ResourceGraph/ResourceGraph/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release * Ignoring subscription from azure context +* Add two examples for cmdlet `Search-AzGraph` with parameter `-Include`. ## Version 0.7.5 * Showing warnings in cases when too many subscriptions were used or results got truncated. diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index 4985642ff4f7..8a0a73c8cea4 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -55,6 +55,27 @@ westus 26 A complex query on resources featuring field selection, filtering and summarizing. +### Example 3 +```powershell +PS C:\> Search-AzGraph -Include DisplayName -Query 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName' + +name resourceGroup subscriptionDisplayName +---- ------------- ----------------------- +ContosoVM RG-Contoso Contoso Production Subscription + +``` +A query featuring all virtual machines which are not using Managed Disks and includes subscription display names. + +### Example 4 +```powershell +PS C:\> Search-AzGraph -Include DisplayName -Query 'summarize count() by tenantDisplayName, subscriptionDisplayName' + +tenantDisplayName subscriptionDisplayName count_ +----------------- ----------------------- ------ +ContosoTenant Contoso Production Subscription 118 +``` +A query displaying the count of resources by tenant and subscription display names. + ## PARAMETERS ### -DefaultProfile