Skip to content

Obsolete all -Tags parameters and add alias to -Tag #5276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 18, 2018
1 change: 1 addition & 0 deletions src/ResourceManager/ApiManagement/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
## Current Release
* Added Location Completer to -Location parameters allowing tab completion through valid Locations
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
* Obsoleted -Tags in favor of -Tag for New-AzureRmApiManagementProperty, Set-AzureRmApiManagementProperty, and New-AzureRmApiManagement

## Version 5.0.1
* Fixed assembly loading issue that caused some cmdlets to fail when executing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,23 @@ public class NewAzureApiManagementProperty : AzureApiManagementCmdletBase
ValueFromPipelineByPropertyName = true,
Mandatory = false,
HelpMessage = "Tags to be associated with Property. This parameter is optional.")]
public string[] Tags { get; set; }
[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.")]
[Alias("Tags")]
public string[] Tag { get; set; }

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

#pragma warning disable CS0618
var logger = Client.PropertyCreate(
Context,
propertyId,
Name,
Value,
Secret,
Tags);
Tag);
#pragma warning restore CS0618

WriteObject(logger);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public class SetAzureApiManagementProperty : AzureApiManagementCmdletBase
ValueFromPipelineByPropertyName = true,
Mandatory = false,
HelpMessage = "Tags associated with a property. This parameter is optional.")]
public string[] Tags { get; set; }
[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.")]
[Alias("Tags")]
public string[] Tag { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
Expand All @@ -74,13 +76,15 @@ public class SetAzureApiManagementProperty : AzureApiManagementCmdletBase

public override void ExecuteApiManagementCmdlet()
{
#pragma warning disable CS0618
Client.PropertySet(
Context,
PropertyId,
Name,
Value,
Secret,
Tags);
Tag);
#pragma warning restore CS0618

if (PassThru)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Commands
{
using Microsoft.Azure.Commands.ApiManagement.Models;
using ResourceManager.Common.ArgumentCompleters;
using System;
using System.Collections.Generic;
using System.Management.Automation;

Expand Down Expand Up @@ -92,7 +93,9 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase
ValueFromPipelineByPropertyName = true,
Mandatory = false,
HelpMessage = "Tags dictionary.")]
public Dictionary<string, string> Tags { get; set; }
[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.")]
[Alias("Tags")]
public Dictionary<string, string> Tag { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
Expand All @@ -102,6 +105,7 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase

public override void ExecuteCmdlet()
{
#pragma warning disable CS0618
ExecuteLongRunningCmdletWrap(
() => Client.BeginCreateApiManagementService(
ResourceGroupName,
Expand All @@ -112,10 +116,11 @@ public override void ExecuteCmdlet()
Sku ?? PsApiManagementSku.Developer,
Capacity ?? 1,
VpnType,
Tags,
Tag,
VirtualNetwork,
AdditionalRegions),
passThru: true);
#pragma warning restore CS0618
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
---
external help file: Microsoft.Azure.Commands.ApiManagement.dll-Help.xml
Module Name: AzureRM.ApiManagement
ms.assetid: 164C5205-01BA-47BB-B780-D0B9AE614A4B
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/new-azurermapimanagement
schema: 2.0.0
Expand All @@ -16,7 +17,7 @@ Creates an API Management deployment.
New-AzureRmApiManagement -ResourceGroupName <String> -Name <String> -Location <String> -Organization <String>
-AdminEmail <String> [-Sku <PsApiManagementSku>] [-Capacity <Int32>] [-VpnType <PsApiManagementVpnType>]
[-VirtualNetwork <PsApiManagementVirtualNetwork>]
[-Tags <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-Tag <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-AdditionalRegions <PsApiManagementRegion[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

Expand Down Expand Up @@ -66,7 +67,7 @@ Additional deployment regions of Azure API Management.
```yaml
Type: PsApiManagementRegion[]
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -81,7 +82,7 @@ Specifies the originating email address for all notifications that the API Manag
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -97,7 +98,7 @@ The default is one (1).
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand Down Expand Up @@ -130,7 +131,7 @@ Get-AzureRmResourceProvider -ProviderNamespace "Microsoft.ApiManagement" | where
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -145,7 +146,7 @@ Specifies a name for the API Management deployment.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -161,7 +162,7 @@ API Management uses this address in the developer portal in email notifications.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -176,7 +177,7 @@ Specifies the name of the of resource group under which this cmdlet creates an A
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -198,7 +199,7 @@ The default is Developer.
```yaml
Type: PsApiManagementSku
Parameter Sets: (All)
Aliases:
Aliases:
Accepted values: Developer, Standard, Premium

Required: False
Expand All @@ -208,13 +209,13 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Tags
Specifies a dictionary of tags.
### -Tag
Tags dictionary.

```yaml
Type: System.Collections.Generic.Dictionary`2[System.String,System.String]
Parameter Sets: (All)
Aliases:
Aliases: Tags

Required: False
Position: Named
Expand All @@ -229,7 +230,7 @@ Virtual Network Configuration of master Azure API Management deployment region.
```yaml
Type: PsApiManagementVirtualNetwork
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -247,7 +248,7 @@ Virtual Network Type of the ApiManagement Deployment. Valid Values are
```yaml
Type: PsApiManagementVpnType
Parameter Sets: (All)
Aliases:
Aliases:
Accepted values: None, External, Internal

Required: False
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
---
external help file: Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-Help.xml
Module Name: AzureRM.ApiManagement
ms.assetid: A91F93D3-B8C7-4328-A049-AB9877C1166C
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/new-azurermapimanagementproperty
schema: 2.0.0
Expand All @@ -14,7 +15,7 @@ Creates a new Property.

```
New-AzureRmApiManagementProperty -Context <PsApiManagementContext> [-PropertyId <String>] -Name <String>
-Value <String> [-Secret] [-Tags <String[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
-Value <String> [-Secret] [-Tag <String[]>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -49,7 +50,7 @@ Specifies a **PsApiManagementContext** object.
```yaml
Type: PsApiManagementContext
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand Down Expand Up @@ -81,7 +82,7 @@ Names contain only letters, digits, period, dash, and underscore characters.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -98,7 +99,7 @@ If you do not specify an ID, this cmdlet generates one.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -113,7 +114,7 @@ Indicates that the property value is a secret and should be encrypted.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -122,14 +123,13 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Tags
Specifies an array of tags that this cmdlet associates to the property.
You can use tags to filter the property list.
### -Tag
Tags to be associated with Property. This parameter is optional.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:
Aliases: Tags

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

Required: True
Position: Named
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
---
external help file: Microsoft.Azure.Commands.ApiManagement.ServiceManagement.dll-Help.xml
Module Name: AzureRM.ApiManagement
ms.assetid: 5C0C437D-7237-4B40-A254-1B55916F1C71
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement/set-azurermapimanagementproperty
schema: 2.0.0
Expand All @@ -14,8 +15,8 @@ Modifies an API Management Property.

```
Set-AzureRmApiManagementProperty -Context <PsApiManagementContext> -PropertyId <String> [-Name <String>]
[-Value <String>] [-Secret <Boolean>] [-Tags <String[]>] [-PassThru]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-Value <String>] [-Secret <Boolean>] [-Tag <String[]>] [-PassThru] [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -51,7 +52,7 @@ Specifies a **PsApiManagementContext** object.
```yaml
Type: PsApiManagementContext
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand Down Expand Up @@ -83,7 +84,7 @@ Names contain only letters, digits, period, dash, and underscore characters.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -98,7 +99,7 @@ Indicates that this cmdlet returns the **PsApiManagementProperty** that this cmd
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -113,7 +114,7 @@ Specifies an ID of the property that this cmdlet modifies.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: Named
Expand All @@ -128,7 +129,7 @@ Indicates that the property value is a secret and should be encrypted.
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: Named
Expand All @@ -137,14 +138,13 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Tags
Specifies an array of tags that this cmdlet associates to the property.
You can use tags to filter the property list.
### -Tag
Tags associated with a property. This parameter is optional.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:
Aliases: Tags

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

Required: False
Position: Named
Expand Down
Loading