You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change parameter sets.
Change Parameter Set.
Add comments.
Disallow combining other filters with tag filters as the service does not
support it.
Address code review comments.
Address code review comments.
Record Scenario Test for find resource by tag.
Update command help.
Update help.
Add new file to csproj.
Correct output settings for the json file for the new test.
Add Change Log.
Fix indentation in ChangeLog.md
Copy file name to clipboardExpand all lines: src/ResourceManager/Resources/ChangeLog.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,9 @@
22
22
## Version 3.4.0
23
23
* Support ResourceNameEquals and ResourceGroupNameEquals as parameters for Find-AzureRmResource
24
24
- Users can now use ResourceNameEquals and ResourceGroupNameEquals with Find-AzureRmResource
25
+
* Support Tag as parameters for Find-AzureRmResource
26
+
- Users can now use Tag parameter with Find-AzureRmResource
27
+
- Fixed the issue where illegal combinations of TagName, TagValue with other search parameters was allowed in Find-AzureRmResource and would result in users getting exception from the service by disallowing such combinations.
25
28
26
29
## Version 3.3.0
27
30
* Lookup of AAD group by Id now uses GetObjectsByObjectId AAD Graph call instead of Groups/<id>
Copy file name to clipboardExpand all lines: src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/FindAzureResourceCmdlet.cs
/// Cmdlet to get existing resources from ARM cache.
@@ -52,6 +55,16 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
52
55
/// </summary>
53
56
internalconststringMultiSubscriptionListResourcesParameterSet="Get a resources using a multi-subscription query.";
54
57
58
+
/// <summary>
59
+
/// The list resources by tag object parameter set.
60
+
/// </summary>
61
+
internalconststringListResourcesByTagObjectParameterSet="Lists resources by a tag object specified as a hashset.";
62
+
63
+
/// <summary>
64
+
/// The list resources by tag name-value parameter set.
65
+
/// </summary>
66
+
internalconststringListResourcesByTagNameValueParameterSet="Lists resources by a tag specified as a individual name and value parameters.";
67
+
55
68
/// <summary>
56
69
/// Caches the current subscription ids to get all subscription ids in the pipeline.
57
70
/// </summary>
@@ -100,6 +113,8 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
100
113
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
101
114
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
102
115
[Parameter(ParameterSetName=FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
116
+
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesByTagObjectParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
117
+
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesByTagNameValueParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
103
118
[ValidateNotNullOrEmpty]
104
119
publicint?Top{get;set;}
105
120
@@ -110,19 +125,20 @@ public sealed class FindAzureResourceCmdlet : ResourceManagerCmdletBase
110
125
[ValidateNotNullOrEmpty]
111
126
publicstringODataQuery{get;set;}
112
127
128
+
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesByTagObjectParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The tag filter for the OData query. The expected format is @{tagName=$null} or @{tagName = 'tagValue'}.")]
129
+
publicHashtableTag{get;set;}
130
+
113
131
/// <summary>
114
132
/// Gets or sets the tag name.
115
133
/// </summary>
116
-
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,HelpMessage="The name of the tag to query by.")]
117
-
[Parameter(ParameterSetName=FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,HelpMessage="The name of the tag to query by.")]
134
+
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesByTagNameValueParameterSet,Mandatory=false,HelpMessage="The name of the tag to query by.")]
118
135
[ValidateNotNullOrEmpty]
119
136
publicstringTagName{get;set;}
120
137
121
138
/// <summary>
122
139
/// Gets or sets the tag value.
123
140
/// </summary>
124
-
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,HelpMessage="The value of the tag to query by.")]
125
-
[Parameter(ParameterSetName=FindAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,HelpMessage="The value of the tag to query by.")]
141
+
[Parameter(ParameterSetName=FindAzureResourceCmdlet.ListResourcesByTagNameValueParameterSet,Mandatory=false,HelpMessage="The value of the tag to query by.")]
0 commit comments