Skip to content

Commit accf20d

Browse files
authored
Merge pull request #5276 from maddieclayton/tags
Obsolete all -Tags parameters and add alias to -Tag
2 parents ada7342 + ef0a487 commit accf20d

File tree

62 files changed

+458
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+458
-348
lines changed

src/ResourceManager/ApiManagement/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Current Release
2121
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
2222
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
23+
* Obsoleted -Tags in favor of -Tag for New-AzureRmApiManagementProperty, Set-AzureRmApiManagementProperty, and New-AzureRmApiManagement
2324

2425
## Version 5.0.1
2526
* Fixed assembly loading issue that caused some cmdlets to fail when executing

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/NewAzureApiManagmentProperty.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,23 @@ public class NewAzureApiManagementProperty : AzureApiManagementCmdletBase
6464
ValueFromPipelineByPropertyName = true,
6565
Mandatory = false,
6666
HelpMessage = "Tags to be associated with Property. This parameter is optional.")]
67-
public string[] Tags { get; set; }
67+
[Obsolete("New-AzureRmApiManagementProperty: -Tags will be removed in favor of -Tag in an upcoming breaking change release. Please start using the -Tag parameter to avoid breaking scripts.")]
68+
[Alias("Tags")]
69+
public string[] Tag { get; set; }
6870

6971
public override void ExecuteApiManagementCmdlet()
7072
{
7173
string propertyId = PropertyId ?? Guid.NewGuid().ToString("N");
7274

75+
#pragma warning disable CS0618
7376
var logger = Client.PropertyCreate(
7477
Context,
7578
propertyId,
7679
Name,
7780
Value,
7881
Secret,
79-
Tags);
82+
Tag);
83+
#pragma warning restore CS0618
8084

8185
WriteObject(logger);
8286
}

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/SetAzureApiManagementProperty.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public class SetAzureApiManagementProperty : AzureApiManagementCmdletBase
6262
ValueFromPipelineByPropertyName = true,
6363
Mandatory = false,
6464
HelpMessage = "Tags associated with a property. This parameter is optional.")]
65-
public string[] Tags { get; set; }
65+
[Obsolete("Set-AzureRmApiManagementProperty: -Tags will be removed in favor of -Tag in an upcoming breaking change release. Please start using the -Tag parameter to avoid breaking scripts.")]
66+
[Alias("Tags")]
67+
public string[] Tag { get; set; }
6668

6769
[Parameter(
6870
ValueFromPipelineByPropertyName = true,
@@ -74,13 +76,15 @@ public class SetAzureApiManagementProperty : AzureApiManagementCmdletBase
7476

7577
public override void ExecuteApiManagementCmdlet()
7678
{
79+
#pragma warning disable CS0618
7780
Client.PropertySet(
7881
Context,
7982
PropertyId,
8083
Name,
8184
Value,
8285
Secret,
83-
Tags);
86+
Tag);
87+
#pragma warning restore CS0618
8488

8589
if (PassThru)
8690
{

src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands/NewAzureApiManagement.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Commands
1616
{
1717
using Microsoft.Azure.Commands.ApiManagement.Models;
1818
using ResourceManager.Common.ArgumentCompleters;
19+
using System;
1920
using System.Collections.Generic;
2021
using System.Management.Automation;
2122

@@ -92,7 +93,9 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase
9293
ValueFromPipelineByPropertyName = true,
9394
Mandatory = false,
9495
HelpMessage = "Tags dictionary.")]
95-
public Dictionary<string, string> Tags { get; set; }
96+
[Obsolete("New-AzureRmApiManagement: -Tags will be removed in favor of -Tag in an upcoming breaking change release. Please start using the -Tag parameter to avoid breaking scripts.")]
97+
[Alias("Tags")]
98+
public Dictionary<string, string> Tag { get; set; }
9699

97100
[Parameter(
98101
ValueFromPipelineByPropertyName = true,
@@ -102,6 +105,7 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase
102105

103106
public override void ExecuteCmdlet()
104107
{
108+
#pragma warning disable CS0618
105109
ExecuteLongRunningCmdletWrap(
106110
() => Client.BeginCreateApiManagementService(
107111
ResourceGroupName,
@@ -112,10 +116,11 @@ public override void ExecuteCmdlet()
112116
Sku ?? PsApiManagementSku.Developer,
113117
Capacity ?? 1,
114118
VpnType,
115-
Tags,
119+
Tag,
116120
VirtualNetwork,
117121
AdditionalRegions),
118122
passThru: true);
123+
#pragma warning restore CS0618
119124
}
120125
}
121126
}

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagement.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.Commands.ApiManagement.dll-Help.xml
3+
Module Name: AzureRM.ApiManagement
34
ms.assetid: 164C5205-01BA-47BB-B780-D0B9AE614A4B
45
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/new-azurermapimanagement
56
schema: 2.0.0
@@ -16,7 +17,7 @@ Creates an API Management deployment.
1617
New-AzureRmApiManagement -ResourceGroupName <String> -Name <String> -Location <String> -Organization <String>
1718
-AdminEmail <String> [-Sku <PsApiManagementSku>] [-Capacity <Int32>] [-VpnType <PsApiManagementVpnType>]
1819
[-VirtualNetwork <PsApiManagementVirtualNetwork>]
19-
[-Tags <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
20+
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
2021
[-AdditionalRegions <PsApiManagementRegion[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2122
```
2223

@@ -66,7 +67,7 @@ Additional deployment regions of Azure API Management.
6667
```yaml
6768
Type: PsApiManagementRegion[]
6869
Parameter Sets: (All)
69-
Aliases:
70+
Aliases:
7071

7172
Required: False
7273
Position: Named
@@ -81,7 +82,7 @@ Specifies the originating email address for all notifications that the API Manag
8182
```yaml
8283
Type: String
8384
Parameter Sets: (All)
84-
Aliases:
85+
Aliases:
8586

8687
Required: True
8788
Position: Named
@@ -97,7 +98,7 @@ The default is one (1).
9798
```yaml
9899
Type: Int32
99100
Parameter Sets: (All)
100-
Aliases:
101+
Aliases:
101102

102103
Required: False
103104
Position: Named
@@ -130,7 +131,7 @@ Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where
130131
```yaml
131132
Type: String
132133
Parameter Sets: (All)
133-
Aliases:
134+
Aliases:
134135

135136
Required: True
136137
Position: Named
@@ -145,7 +146,7 @@ Specifies a name for the API Management deployment.
145146
```yaml
146147
Type: String
147148
Parameter Sets: (All)
148-
Aliases:
149+
Aliases:
149150

150151
Required: True
151152
Position: Named
@@ -161,7 +162,7 @@ API Management uses this address in the developer portal in email notifications.
161162
```yaml
162163
Type: String
163164
Parameter Sets: (All)
164-
Aliases:
165+
Aliases:
165166

166167
Required: True
167168
Position: Named
@@ -176,7 +177,7 @@ Specifies the name of the of resource group under which this cmdlet creates an A
176177
```yaml
177178
Type: String
178179
Parameter Sets: (All)
179-
Aliases:
180+
Aliases:
180181

181182
Required: True
182183
Position: Named
@@ -198,7 +199,7 @@ The default is Developer.
198199
```yaml
199200
Type: PsApiManagementSku
200201
Parameter Sets: (All)
201-
Aliases:
202+
Aliases:
202203
Accepted values: Developer, Standard, Premium
203204

204205
Required: False
@@ -208,13 +209,13 @@ Accept pipeline input: True (ByPropertyName)
208209
Accept wildcard characters: False
209210
```
210211
211-
### -Tags
212-
Specifies a dictionary of tags.
212+
### -Tag
213+
Tags dictionary.
213214
214215
```yaml
215216
Type: System.Collections.Generic.Dictionary`2[System.String,System.String]
216217
Parameter Sets: (All)
217-
Aliases:
218+
Aliases: Tags
218219

219220
Required: False
220221
Position: Named
@@ -229,7 +230,7 @@ Virtual Network Configuration of master Azure API Management deployment region.
229230
```yaml
230231
Type: PsApiManagementVirtualNetwork
231232
Parameter Sets: (All)
232-
Aliases:
233+
Aliases:
233234

234235
Required: False
235236
Position: Named
@@ -247,7 +248,7 @@ Virtual Network Type of the ApiManagement Deployment. Valid Values are
247248
```yaml
248249
Type: PsApiManagementVpnType
249250
Parameter Sets: (All)
250-
Aliases:
251+
Aliases:
251252
Accepted values: None, External, Internal
252253

253254
Required: False

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/New-AzureRmApiManagementProperty.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-Help.xml
3+
Module Name: AzureRM.ApiManagement
34
ms.assetid: A91F93D3-B8C7-4328-A049-AB9877C1166C
45
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/new-azurermapimanagementproperty
56
schema: 2.0.0
@@ -14,7 +15,7 @@ Creates a new Property.
1415

1516
```
1617
New-AzureRmApiManagementProperty -Context <PsApiManagementContext> [-PropertyId <String>] -Name <String>
17-
-Value <String> [-Secret] [-Tags <String[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
18+
-Value <String> [-Secret] [-Tag <String[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1819
```
1920

2021
## DESCRIPTION
@@ -49,7 +50,7 @@ Specifies a **PsApiManagementContext** object.
4950
```yaml
5051
Type: PsApiManagementContext
5152
Parameter Sets: (All)
52-
Aliases:
53+
Aliases:
5354

5455
Required: True
5556
Position: Named
@@ -81,7 +82,7 @@ Names contain only letters, digits, period, dash, and underscore characters.
8182
```yaml
8283
Type: String
8384
Parameter Sets: (All)
84-
Aliases:
85+
Aliases:
8586

8687
Required: True
8788
Position: Named
@@ -98,7 +99,7 @@ If you do not specify an ID, this cmdlet generates one.
9899
```yaml
99100
Type: String
100101
Parameter Sets: (All)
101-
Aliases:
102+
Aliases:
102103

103104
Required: False
104105
Position: Named
@@ -113,7 +114,7 @@ Indicates that the property value is a secret and should be encrypted.
113114
```yaml
114115
Type: SwitchParameter
115116
Parameter Sets: (All)
116-
Aliases:
117+
Aliases:
117118

118119
Required: False
119120
Position: Named
@@ -122,14 +123,13 @@ Accept pipeline input: True (ByPropertyName)
122123
Accept wildcard characters: False
123124
```
124125
125-
### -Tags
126-
Specifies an array of tags that this cmdlet associates to the property.
127-
You can use tags to filter the property list.
126+
### -Tag
127+
Tags to be associated with Property. This parameter is optional.
128128
129129
```yaml
130130
Type: String[]
131131
Parameter Sets: (All)
132-
Aliases:
132+
Aliases: Tags
133133

134134
Required: False
135135
Position: Named
@@ -147,7 +147,7 @@ The value may not be empty or consist only of whitespace.
147147
```yaml
148148
Type: String
149149
Parameter Sets: (All)
150-
Aliases:
150+
Aliases:
151151

152152
Required: True
153153
Position: Named

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/Set-AzureRmApiManagementProperty.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-Help.xml
3+
Module Name: AzureRM.ApiManagement
34
ms.assetid: 5C0C437D-7237-4B40-A254-1B55916F1C71
45
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/set-azurermapimanagementproperty
56
schema: 2.0.0
@@ -14,8 +15,8 @@ Modifies an API Management Property.
1415

1516
```
1617
Set-AzureRmApiManagementProperty -Context <PsApiManagementContext> -PropertyId <String> [-Name <String>]
17-
[-Value <String>] [-Secret <Boolean>] [-Tags <String[]>] [-PassThru]
18-
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
18+
[-Value <String>] [-Secret <Boolean>] [-Tag <String[]>] [-PassThru] [-DefaultProfile <IAzureContextContainer>]
19+
[<CommonParameters>]
1920
```
2021

2122
## DESCRIPTION
@@ -51,7 +52,7 @@ Specifies a **PsApiManagementContext** object.
5152
```yaml
5253
Type: PsApiManagementContext
5354
Parameter Sets: (All)
54-
Aliases:
55+
Aliases:
5556

5657
Required: True
5758
Position: Named
@@ -83,7 +84,7 @@ Names contain only letters, digits, period, dash, and underscore characters.
8384
```yaml
8485
Type: String
8586
Parameter Sets: (All)
86-
Aliases:
87+
Aliases:
8788

8889
Required: False
8990
Position: Named
@@ -98,7 +99,7 @@ Indicates that this cmdlet returns the **PsApiManagementProperty** that this cmd
9899
```yaml
99100
Type: SwitchParameter
100101
Parameter Sets: (All)
101-
Aliases:
102+
Aliases:
102103

103104
Required: False
104105
Position: Named
@@ -113,7 +114,7 @@ Specifies an ID of the property that this cmdlet modifies.
113114
```yaml
114115
Type: String
115116
Parameter Sets: (All)
116-
Aliases:
117+
Aliases:
117118

118119
Required: True
119120
Position: Named
@@ -128,7 +129,7 @@ Indicates that the property value is a secret and should be encrypted.
128129
```yaml
129130
Type: Boolean
130131
Parameter Sets: (All)
131-
Aliases:
132+
Aliases:
132133

133134
Required: False
134135
Position: Named
@@ -137,14 +138,13 @@ Accept pipeline input: True (ByPropertyName)
137138
Accept wildcard characters: False
138139
```
139140
140-
### -Tags
141-
Specifies an array of tags that this cmdlet associates to the property.
142-
You can use tags to filter the property list.
141+
### -Tag
142+
Tags associated with a property. This parameter is optional.
143143
144144
```yaml
145145
Type: String[]
146146
Parameter Sets: (All)
147-
Aliases:
147+
Aliases: Tags
148148

149149
Required: False
150150
Position: Named
@@ -162,7 +162,7 @@ The value may not be empty or consist only of whitespace.
162162
```yaml
163163
Type: String
164164
Parameter Sets: (All)
165-
Aliases:
165+
Aliases:
166166

167167
Required: False
168168
Position: Named

0 commit comments

Comments
 (0)