From cc484e5b64fb5960d08366c6c80f0b4fe350618d Mon Sep 17 00:00:00 2001 From: makharch Date: Thu, 27 May 2021 18:04:05 -0700 Subject: [PATCH 1/6] Fixed null subscriptions exception, added change log --- src/ResourceGraph/ResourceGraph/ChangeLog.md | 1 + .../ResourceGraph/Cmdlets/SearchAzureRmGraph.cs | 4 ++-- src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ResourceGraph/ResourceGraph/ChangeLog.md b/src/ResourceGraph/ResourceGraph/ChangeLog.md index b0c35744ab08..000c10217c54 100644 --- a/src/ResourceGraph/ResourceGraph/ChangeLog.md +++ b/src/ResourceGraph/ResourceGraph/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed the output print issue for `Search-AzGraph`. Fixed the issue when Search-AzGraph fails when no subscriptions are stored in the context. ## Version 0.10.0 * Changed output of `Search-AzGraph` to PSResourceGraphResponse which wrapped previous output under Data property. diff --git a/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs b/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs index 674d722d56da..19ef4762a0d1 100644 --- a/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs +++ b/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs @@ -150,7 +150,7 @@ public override void ExecuteCmdlet() IList subscriptions = null; if (managementGroups == null) { - subscriptions = this.GetSubscriptions().ToList(); + subscriptions = this.GetSubscriptions()?.ToList(); if (subscriptions != null && subscriptions.Count > SubscriptionLimit) { subscriptions = subscriptions.Take(SubscriptionLimit).ToList(); @@ -262,7 +262,7 @@ private IEnumerable GetSubscriptions() } var accountSubscriptions = this.DefaultContext.Account.GetSubscriptions(); - if (accountSubscriptions.Length > 0) + if (accountSubscriptions?.Length > 0) { return accountSubscriptions; } diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index cd4d771d943f..fa70b00c36bd 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -64,7 +64,8 @@ A complex query on resources featuring field selection, filtering and summarizin ### Example 3 ```powershell -PS C:\> Search-AzGraph -Query 'project id, name' -SkipToken 'skiptokenvaluefromthepreviousquery==' +PS C:\> $response = (Search-AzGraph -Query 'project id, name' -First 1000) +PS C:\> Search-AzGraph -Query 'project id, name' -SkipToken $response.SkipToken id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-b/providers/Microsoft.Compute/virtualMachineScaleSets/nt2 @@ -74,7 +75,7 @@ id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/ name : egtopic-2 ``` -A query with the skip token passed from the previous query results +A query with the skip token passed from the previous query results. Please note that keeping id in the results is mandatory to get back a skip token. ### Example 4 ```powershell From 98014e036bfc0965ca1968b7ccf20dbbe0c9e6b5 Mon Sep 17 00:00:00 2001 From: makharch Date: Thu, 27 May 2021 18:28:08 -0700 Subject: [PATCH 2/6] Added output type fix and updated tests Changes from PR https://github.com/Azure/azure-powershell/pull/15125 --- .../ScenarioTests/ResourceGraphQueryTests.ps1 | 18 +++++----- .../ResourceGraph/Az.ResourceGraph.psd1 | 2 +- .../Cmdlets/SearchAzureRmGraph.cs | 4 +-- .../Models/PSResourceGraphResponse.cs | 36 +++++++++++++++++-- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/ResourceGraph/ResourceGraph.Test/ScenarioTests/ResourceGraphQueryTests.ps1 b/src/ResourceGraph/ResourceGraph.Test/ScenarioTests/ResourceGraphQueryTests.ps1 index baa48a3dfb79..71cdff1996e4 100644 --- a/src/ResourceGraph/ResourceGraph.Test/ScenarioTests/ResourceGraphQueryTests.ps1 +++ b/src/ResourceGraph/ResourceGraph.Test/ScenarioTests/ResourceGraphQueryTests.ps1 @@ -19,8 +19,8 @@ Run simple query function Search-AzureRmGraph-Query { $queryResult = Search-AzGraph 'Resources | where tags != "" | project id, tags, properties | limit 2' - - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResult + + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResult Assert-Null $queryResult.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResult.Data Assert-AreEqual 2 $queryResult.Data.Count @@ -55,7 +55,7 @@ function Search-AzureRmGraph-PagedQuery # Page size was artificially set to 2 rows $queryResult = Search-AzGraph "project id" -First 3 -Skip 2 - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResult + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResult Assert-IsInstance System.String $queryResult.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResult.Data Assert-AreEqual 3 $queryResult.Data.Count @@ -95,17 +95,17 @@ function Search-AzureRmGraph-Subscriptions $queryResultOneSub = Search-AzGraph $query -Subscription $testSubId $queryResultMultipleSubs = Search-AzGraph $query -Subscription @($testSubId, $nonExsitentTestSubId) - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResultSubsFromContext + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResultSubsFromContext Assert-Null $queryResultSubsFromContext.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResultSubsFromContext.Data Assert-AreEqual $testSubId $queryResultSubsFromContext.Data.subscriptionId - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResultOneSub + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResultOneSub Assert-Null $queryResultOneSub.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResultOneSub.Data Assert-AreEqual $testSubId $queryResultOneSub.Data.subscriptionId - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResultMultipleSubs + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResultMultipleSubs Assert-Null $queryResultMultipleSubs.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResultMultipleSubs.Data Assert-AreEqual $testSubId $queryResultMultipleSubs.Data.subscriptionId @@ -126,12 +126,12 @@ function Search-AzureRmGraph-ManagementGroups $queryResultOneMg = Search-AzGraph $query -ManagementGroup $testMgId1 $queryResultMultipleMgs = Search-AzGraph $query -ManagementGroup @($testMgId1, $testMgId2, $nonExistentTestMgId) -AllowPartialScope - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResultOneMg + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResultOneMg Assert-Null $queryResultOneMg.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResultOneMg.Data Assert-AreEqual $testSubId $queryResultOneMg.Data.subscriptionId - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResultMultipleMgs + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResultMultipleMgs Assert-Null $queryResultMultipleMgs.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResultMultipleMgs.Data Assert-AreEqual $testSubId $queryResultMultipleMgs.Data.subscriptionId @@ -145,7 +145,7 @@ function Search-AzureRmGraph-SkipTokenQuery { $queryResult = Search-AzGraph "project id, properties" -SkipToken "ew0KICAiJGlkIjogIjEiLA0KICAiTWF4Um93cyI6IDMsDQogICJSb3dzVG9Ta2lwIjogMywNCiAgIkt1c3RvQ2x1c3RlclVybCI6ICJodHRwczovL2FyZy1ldXMtc2l4LXNmLmFyZy5jb3JlLndpbmRvd3MubmV0Ig0KfQ==" - Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse $queryResult + Assert-IsInstance Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse[PSObject] $queryResult Assert-IsInstance System.String $queryResult.SkipToken Assert-IsInstance System.Collections.Generic.List[PSObject] $queryResult.Data Assert-AreEqual 3 $queryResult.Data.Count diff --git a/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 b/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 index 29b3d7e14b69..f033d314e215 100644 --- a/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 +++ b/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 @@ -70,7 +70,7 @@ FormatsToProcess = 'ResourceGraph.format.ps1xml', 'ResourceGraph.Autorest\Az.ResourceGraph.format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -NestedModules = @('Az.ResourceGraph.psm1', +NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.dll', 'ResourceGraph.Autorest\Az.ResourceGraph.psm1') # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. diff --git a/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs b/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs index 19ef4762a0d1..a8d7a79313ca 100644 --- a/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs +++ b/src/ResourceGraph/ResourceGraph/Cmdlets/SearchAzureRmGraph.cs @@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.ResourceGraph.Cmdlets /// Search-AzGraph cmdlet /// /// - [Cmdlet(VerbsCommon.Search, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Graph", DefaultParameterSetName = "SubscriptionScopedQuery"), OutputType(typeof(PSResourceGraphResponse))] + [Cmdlet(VerbsCommon.Search, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "Graph", DefaultParameterSetName = "SubscriptionScopedQuery"), OutputType(typeof(PSResourceGraphResponse))] public class SearchAzureRmGraph : ResourceGraphBaseCmdlet { /// @@ -160,7 +160,7 @@ public override void ExecuteCmdlet() } } - var psResourceGraphResponse = new PSResourceGraphResponse(); + var psResourceGraphResponse = new PSResourceGraphResponse(); QueryResponse response = null; var resultTruncated = false; diff --git a/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs b/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs index 96e81b15eb35..66f75638bde9 100644 --- a/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs +++ b/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs @@ -14,17 +14,49 @@ namespace Microsoft.Azure.Commands.ResourceGraph.Models { + using System.Collections; using System.Collections.Generic; - using System.Management.Automation; using Microsoft.WindowsAzure.Commands.Common.Attributes; - public class PSResourceGraphResponse + public class PSResourceGraphResponse : IList { [Ps1Xml(Target = ViewControl.List)] public string SkipToken { get; set; } [Ps1Xml(Target = ViewControl.List)] public IList Data { get; set; } + public PSObject this[int index] { get => Data[index]; set => Data[index] = value; } + public IEnumerator GetEnumerator() + { + return Data.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public bool IsReadOnly => Data.IsReadOnly; + + public int Count => Data.Count; + + public void Add(PSObject value) => Data.Add(value); + + public void Clear() => Data.Clear(); + + public bool Contains(PSObject value) => Data.Contains(value); + + public void CopyTo(PSObject[] array, int index) => Data.CopyTo(array, index); + + public int IndexOf(PSObject value) => Data.IndexOf(value); + + public void Insert(int index, PSObject value) => Data.Insert(index, value); + + public void Remove(PSObject value) => Data.Remove(value); + + public void RemoveAt(int index) => Data.RemoveAt(index); + + bool ICollection.Remove(PSObject item) => Data.Remove(item); } } From 20b60e49046a7539148602d6f3f8cecf870666bd Mon Sep 17 00:00:00 2001 From: makharch Date: Fri, 28 May 2021 15:34:11 -0700 Subject: [PATCH 3/6] regenerated ps1xml, updated examples --- .../ResourceGraph/Az.ResourceGraph.psd1 | 2 +- src/ResourceGraph/ResourceGraph/ChangeLog.md | 3 ++- ...ets.ResourceGraph.generated.format.ps1xml} | 15 ++++-------- .../Models/PSResourceGraphResponse.cs | 6 ++++- .../ResourceGraph/help/Search-AzGraph.md | 24 +++++++++++++------ 5 files changed, 30 insertions(+), 20 deletions(-) rename src/ResourceGraph/ResourceGraph/{ResourceGraph.format.ps1xml => Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.generated.format.ps1xml} (64%) diff --git a/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 b/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 index f033d314e215..0c34a6f1dbe3 100644 --- a/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 +++ b/src/ResourceGraph/ResourceGraph/Az.ResourceGraph.psd1 @@ -66,7 +66,7 @@ RequiredAssemblies = 'Microsoft.Azure.Management.ResourceGraph.dll', # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module -FormatsToProcess = 'ResourceGraph.format.ps1xml', +FormatsToProcess = 'Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.generated.format.ps1xml', 'ResourceGraph.Autorest\Az.ResourceGraph.format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess diff --git a/src/ResourceGraph/ResourceGraph/ChangeLog.md b/src/ResourceGraph/ResourceGraph/ChangeLog.md index 000c10217c54..3a976e1f23bc 100644 --- a/src/ResourceGraph/ResourceGraph/ChangeLog.md +++ b/src/ResourceGraph/ResourceGraph/ChangeLog.md @@ -18,7 +18,8 @@ - Additional information about change #1 --> ## Upcoming Release -* Fixed the output print issue for `Search-AzGraph`. Fixed the issue when Search-AzGraph fails when no subscriptions are stored in the context. +* Fixed the output print issue for `Search-AzGraph`. +* Fixed the issue when Search-AzGraph fails if no subscriptions are stored in the context. ## Version 0.10.0 * Changed output of `Search-AzGraph` to PSResourceGraphResponse which wrapped previous output under Data property. diff --git a/src/ResourceGraph/ResourceGraph/ResourceGraph.format.ps1xml b/src/ResourceGraph/ResourceGraph/Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.generated.format.ps1xml similarity index 64% rename from src/ResourceGraph/ResourceGraph/ResourceGraph.format.ps1xml rename to src/ResourceGraph/ResourceGraph/Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.generated.format.ps1xml index c37333a6aec6..376e897d9630 100644 --- a/src/ResourceGraph/ResourceGraph/ResourceGraph.format.ps1xml +++ b/src/ResourceGraph/ResourceGraph/Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.generated.format.ps1xml @@ -1,10 +1,10 @@ - + - Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse + Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse`1[[System.Management.Automation.PSObject]] - Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse + Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse`1[[System.Management.Automation.PSObject]] @@ -12,19 +12,14 @@ SkipToken - - - $_.SkipToken -ne $null - - Data - + - + \ No newline at end of file diff --git a/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs b/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs index 66f75638bde9..31534deadb6e 100644 --- a/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs +++ b/src/ResourceGraph/ResourceGraph/Models/PSResourceGraphResponse.cs @@ -25,7 +25,11 @@ public class PSResourceGraphResponse : IList [Ps1Xml(Target = ViewControl.List)] public IList Data { get; set; } - public PSObject this[int index] { get => Data[index]; set => Data[index] = value; } + public PSObject this[int index] + { + get => Data[index]; + set => Data[index] = value; + } public IEnumerator GetEnumerator() { diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index fa70b00c36bd..f4c9a957f2ea 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -39,12 +39,14 @@ name : nt type : microsoft.compute/virtualmachinescalesets location : eastus tags : @{resourceType=Service Fabric; clusterName=gov-art-int-nt-a} +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1 name : egtopic-1 type : microsoft.eventgrid/topics location : westus2 tags : +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1 ``` Simple resources query requesting a subset of resource fields. @@ -64,22 +66,28 @@ A complex query on resources featuring field selection, filtering and summarizin ### Example 3 ```powershell -PS C:\> $response = (Search-AzGraph -Query 'project id, name' -First 1000) -PS C:\> Search-AzGraph -Query 'project id, name' -SkipToken $response.SkipToken +PS C:\> $response = Search-AzGraph -Query "project id, name, type, location" -First 2 +PS C:\> Search-AzGraph -Query "project id, name, type, location" -SkipToken $response.SkipToken -id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-b/providers/Microsoft.Compute/virtualMachineScaleSets/nt2 -name : nt2 +id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkInterfaces/17ni +name : 17ni +type : microsoft.network/networkinterfaces +location : westeurope +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkInterfaces/17ni -id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-b/providers/Microsoft.EventGrid/topics/egtopic-2 -name : egtopic-2 +id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkSecurityGroups/17nsg +name : 17nsg +type : microsoft.network/networksecuritygroups +location : westeurope +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/test/providers/Microsoft.Network/networkSecurityGroups/17nsg ``` A query with the skip token passed from the previous query results. Please note that keeping id in the results is mandatory to get back a skip token. ### Example 4 ```powershell -PS C:\> Search-AzGraph -Query 'project id, name, type, location, tags' -First 2 -ManagementGroup 'MyManagementGroupId' -AllowPartialScope +PS C:\> Search-AzGraph -Query "project id, name, type, location, tags" -First 2 -ManagementGroup MyManagementGroupId -AllowPartialScope id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt @@ -87,12 +95,14 @@ name : nt type : microsoft.compute/virtualmachinescalesets location : eastus tags : @{resourceType=Service Fabric; clusterName=gov-art-int-nt-a} +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.Compute/virtualMachineScaleSets/nt id : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1 name : egtopic-1 type : microsoft.eventgrid/topics location : westus2 tags : +ResourceId : /subscriptions/1ef51df4-f8a9-4b69-9919-1ef51df4eff6/resourceGroups/Service-INT-a/providers/Microsoft.EventGrid/topics/egtopic-1 ``` A query scoped to the management group that allows the query to succeed with partial scope result if MyManagementGroupId has more than N subscriptions underneath. From 715c66ffa97fd3dec24ad99b3e353237189a90bc Mon Sep 17 00:00:00 2001 From: makharch Date: Tue, 1 Jun 2021 23:41:59 -0700 Subject: [PATCH 4/6] Updated md file for the output type and changelog --- src/ResourceGraph/ResourceGraph/ChangeLog.md | 2 +- src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ResourceGraph/ResourceGraph/ChangeLog.md b/src/ResourceGraph/ResourceGraph/ChangeLog.md index 3a976e1f23bc..2c6fb3a64f1e 100644 --- a/src/ResourceGraph/ResourceGraph/ChangeLog.md +++ b/src/ResourceGraph/ResourceGraph/ChangeLog.md @@ -18,7 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release -* Fixed the output print issue for `Search-AzGraph`. +* Fixed the output print issue for `Search-AzGraph` by updating the output type to Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse`1[[System.Management.Automation.PSObject]]. * Fixed the issue when Search-AzGraph fails if no subscriptions are stored in the context. ## Version 0.10.0 diff --git a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md index f4c9a957f2ea..5b06bda9f2b2 100644 --- a/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md +++ b/src/ResourceGraph/ResourceGraph/help/Search-AzGraph.md @@ -240,7 +240,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse +### Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse`1[[System.Management.Automation.PSObject]] ## NOTES From 2ed371a45755badbf727c7a184a567f5f4437c49 Mon Sep 17 00:00:00 2001 From: makharch Date: Tue, 8 Jun 2021 23:34:34 -0700 Subject: [PATCH 5/6] added breaking change issues csv after rebasing with master --- .../Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv diff --git a/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv new file mode 100644 index 000000000000..8f596855beb8 --- /dev/null +++ b/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv @@ -0,0 +1,2 @@ +AssemblyFileName,ClassName,Target,Severity,ProblemId,Description,Remediation +Az.ResourceGraph,Microsoft.Azure.Commands.ResourceGraph.Cmdlets.SearchAzureRmGraph,Search-AzGraph,0,1020,The cmdlet 'Search-AzGraph' no longer has output type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'.,Make cmdlet 'Search-AzGraph' return type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'. From 6c8892b9058c68c97fc247177ec2e88d4b26f87b Mon Sep 17 00:00:00 2001 From: makharch Date: Tue, 8 Jun 2021 23:54:07 -0700 Subject: [PATCH 6/6] added parenthesses to csv to fix parsing issue --- .../Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv index 8f596855beb8..ef3ddfe731ab 100644 --- a/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.ResourceGraph/BreakingChangeIssues.csv @@ -1,2 +1,2 @@ -AssemblyFileName,ClassName,Target,Severity,ProblemId,Description,Remediation -Az.ResourceGraph,Microsoft.Azure.Commands.ResourceGraph.Cmdlets.SearchAzureRmGraph,Search-AzGraph,0,1020,The cmdlet 'Search-AzGraph' no longer has output type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'.,Make cmdlet 'Search-AzGraph' return type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'. +"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" +"Az.ResourceGraph","Microsoft.Azure.Commands.ResourceGraph.Cmdlets.SearchAzureRmGraph","Search-AzGraph","0","1020","The cmdlet 'Search-AzGraph' no longer has output type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'.","Make cmdlet 'Search-AzGraph' return type 'Microsoft.Azure.Commands.ResourceGraph.Models.PSResourceGraphResponse'."