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
Copy file name to clipboardExpand all lines: src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/GetAzureResourceCmdlet.cs
internalconststringListResourcesParameterSet="Lists the resources based on the specified scope.";
44
-
43
+
internalconststringParameterlessSet="The list all resources parameter set.";
44
+
45
45
/// <summary>
46
46
/// The get resource parameter set.
47
47
/// </summary>
48
-
internalconststringGetResourceParameterSet="Get a single resource.";
48
+
internalconststringGetResourceByNameTypeParameterSet="Get a resource by name and type.";
49
49
50
50
/// <summary>
51
51
/// The list tenant resources parameter set.
@@ -58,14 +58,19 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
58
58
internalconststringGetTenantResourceParameterSet="Get a single resource at the tenant level.";
59
59
60
60
/// <summary>
61
-
/// The get tenant resource parameter set.
61
+
/// The get resource Id parameter set.
62
62
/// </summary>
63
63
internalconststringGetResourceByIdParameterSet="Get a single resource by its Id.";
64
64
65
65
/// <summary>
66
-
/// The get tenant resource parameter set.
66
+
/// The list resources by name and resource group set.
67
+
/// </summary>
68
+
internalconststringGetResourceByNameGroupParameterSet="Get resource by name and group";
69
+
70
+
/// <summary>
71
+
/// The list resources by name and resource group set.
67
72
/// </summary>
68
-
internalconststringMultiSubscriptionListResourcesParameterSet="Get a resources using a multi-subscription query.";
73
+
internalconststringGetResourceByNameGroupTypeParameterSet="Get resource by name, group and type";
69
74
70
75
/// <summary>
71
76
/// Caches the current subscription ids to get all subscription ids in the pipeline.
@@ -85,43 +90,42 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
85
90
/// </summary>
86
91
[Alias("Name")]
87
92
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetTenantResourceParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
88
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
89
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
90
93
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
91
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
94
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
95
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
96
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource name. e.g. to specify a database MyServer/MyDatabase.")]
92
97
[ValidateNotNullOrEmpty]
93
98
publicstringResourceName{get;set;}
94
99
95
100
/// <summary>
96
101
/// Gets or sets the resource type parameter.
97
102
/// </summary>
98
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
99
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
100
103
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetTenantResourceParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
101
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
102
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
104
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
105
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
106
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
103
107
[ValidateNotNullOrEmpty]
104
108
publicstringResourceType{get;set;}
105
109
106
110
/// <summary>
107
111
/// Gets or sets the extension resource name parameter.
108
112
/// </summary>
109
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource name. e.g. to specify a database MyServer/MyDatabase.")]
110
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource name. e.g. to specify a database MyServer/MyDatabase.")]
111
113
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetTenantResourceParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource name. e.g. to specify a database MyServer/MyDatabase.")]
112
114
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
113
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
115
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
116
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource name. e.g. to specify a database MyServer/MyDatabase.")]
117
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
114
118
[ValidateNotNullOrEmpty]
115
119
publicstringExtensionResourceName{get;set;}
116
120
117
121
/// <summary>
118
122
/// Gets or sets the extension resource type.
119
123
/// </summary>
120
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
121
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
122
124
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetTenantResourceParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
123
125
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
124
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
126
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
127
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
128
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The extension resource type. e.g. Microsoft.Sql/Servers/Databases.")]
125
129
[ValidateNotNullOrEmpty]
126
130
publicstringExtensionResourceType{get;set;}
127
131
@@ -136,17 +140,15 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
136
140
/// </summary>
137
141
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetTenantResourceParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
138
142
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
139
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
140
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
141
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
143
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameTypeParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
144
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
145
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=false,HelpMessage="When specified, ensures that the query is run against a collection instead of a resource.")]
142
146
publicSwitchParameterIsCollection{get;set;}
143
147
144
148
/// <summary>
145
149
/// Gets or sets the top parameter.
146
150
/// </summary>
147
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
148
151
[Parameter(ParameterSetName=GetAzureResourceCmdlet.ListTenantResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
149
-
[Parameter(ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,Mandatory=false,HelpMessage="The number of resources to retrieve.")]
150
152
[ValidateNotNullOrEmpty]
151
153
publicint?Top{get;set;}
152
154
@@ -160,9 +162,8 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase
160
162
/// <summary>
161
163
/// Gets or sets the resource group name.
162
164
/// </summary>
163
-
[Parameter(Mandatory=false,ParameterSetName=GetAzureResourceCmdlet.GetResourceParameterSet,ValueFromPipelineByPropertyName=true,HelpMessage="The resource group name.")]
164
-
[Parameter(Mandatory=false,ParameterSetName=GetAzureResourceCmdlet.ListResourcesParameterSet,ValueFromPipelineByPropertyName=true,HelpMessage="The resource group name.")]
165
-
[Parameter(Mandatory=false,ParameterSetName=GetAzureResourceCmdlet.MultiSubscriptionListResourcesParameterSet,ValueFromPipelineByPropertyName=true,HelpMessage="The resource group name.")]
165
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource group name.")]
166
+
[Parameter(ParameterSetName=GetAzureResourceCmdlet.GetResourceByNameGroupTypeParameterSet,Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The resource group name.")]
0 commit comments