From 72a0053210cdf3bf8628a308bdf7c32994a40008 Mon Sep 17 00:00:00 2001 From: MattiasAng <31220729+MattiasAng@users.noreply.github.com> Date: Thu, 19 Sep 2019 23:50:38 +0200 Subject: [PATCH 1/4] Added -Include parameter with example --- .../ResourceGraph/help/Search-AzGraph.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index 4985642ff4f7..07522013b244 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -55,6 +55,18 @@ westus 26 A complex query on resources featuring field selection, filtering and summarizing. +### Example 3 +```powershell +PS C:\> Search-AzGraph -Query 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName' -Include DisplayName + +name resourceGroup subscriptionDisplayName +---- ------------- ----------------------- +ContosoVM RG-Contoso Contoso Production Subscription + +``` + +A query featuring all virtual machines which are not using Managed Disks and includes subscription displayname. + ## PARAMETERS ### -DefaultProfile @@ -126,6 +138,20 @@ Type: System.Int32 Parameter Sets: (All) Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` +### -Include +Set to 'DisplayNames' to add subscriptionDisplayName and tenantDisplayName to the results. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + Required: False Position: Named Default value: None From 6ba8707494450df431e1cc4419c0e7efb615b3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20=C3=84ngehov?= Date: Sun, 6 Oct 2019 10:55:06 +0200 Subject: [PATCH 2/4] example for tenant displayname --- .../ResourceGraph/help/Search-AzGraph.md | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index 07522013b244..0e6c9c4b1a8e 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -57,16 +57,25 @@ A complex query on resources featuring field selection, filtering and summarizin ### Example 3 ```powershell -PS C:\> Search-AzGraph -Query 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName' -Include DisplayName +PS C:\> Search-AzGraph -Query -Include DisplayName '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 displayname. +### Example 4 +```powershell +PS C:\> Search-AzGraph -Query -Include DisplayName 'summarize count() by tenantDisplayName, subscriptionDisplayName' + +tenantDisplayName subscriptionDisplayName count_ +----------------- ----------------------- ------ +ContosoTenant Contoso Production Subscription 118 +``` +A query displaying the count of resources by tenant and subscription displayname. + ## PARAMETERS ### -DefaultProfile @@ -138,20 +147,6 @@ Type: System.Int32 Parameter Sets: (All) Aliases: -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` -### -Include -Set to 'DisplayNames' to add subscriptionDisplayName and tenantDisplayName to the results. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - Required: False Position: Named Default value: None From 9494c492d87d616afacf297585b7f899a5ad5a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20=C3=84ngehov?= Date: Wed, 9 Oct 2019 20:17:33 +0200 Subject: [PATCH 3/4] fixed parameters --- src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index 0e6c9c4b1a8e..8a0a73c8cea4 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -57,24 +57,24 @@ A complex query on resources featuring field selection, filtering and summarizin ### Example 3 ```powershell -PS C:\> Search-AzGraph -Query -Include DisplayName 'where type =~ "Microsoft.Compute/virtualMachines"| where properties.storageProfile.osDisk.managedDisk == "" | project name, resourceGroup, subscriptionDisplayName' +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 displayname. +A query featuring all virtual machines which are not using Managed Disks and includes subscription display names. ### Example 4 ```powershell -PS C:\> Search-AzGraph -Query -Include DisplayName 'summarize count() by tenantDisplayName, subscriptionDisplayName' +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 displayname. +A query displaying the count of resources by tenant and subscription display names. ## PARAMETERS From 7dcc3a82f7fe3399878b37e91c532f4b1cecfe6d Mon Sep 17 00:00:00 2001 From: wyunchi-ms <54880216+wyunchi-ms@users.noreply.github.com> Date: Tue, 5 Nov 2019 16:39:51 +0800 Subject: [PATCH 4/4] Update ChangeLog.md --- src/ResourceGraph/ResourceGraph/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) 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.