Skip to content

Commit 8cdf911

Browse files
authored
Merge pull request Azure#4662 from maddieclayton/ObsoleteStrings
Obsolete strings
2 parents 241c795 + 0aa8c35 commit 8cdf911

File tree

20 files changed

+242
-7
lines changed

20 files changed

+242
-7
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ public class NewAzureApiManagementBackendProxy : AzureApiManagementCmdletBase
3636
ValueFromPipelineByPropertyName = false,
3737
Mandatory = false,
3838
HelpMessage = "UserName used to connect to Backend Proxy. This parameter is optional.")]
39+
[Obsolete("New-AzureRmApiManagementBackendProxy: The parameter \"UserName\" is being removed in a future release in favor of a new PSCredential parameter (-Credential).")]
3940
public string UserName { get; set; }
4041

4142
[Parameter(
4243
ValueFromPipelineByPropertyName = false,
4344
Mandatory = false,
4445
HelpMessage = "Password used to connect to Backend Proxy. This parameter is optional.")]
46+
[Obsolete("New-AzureRmApiManagementBackendProxy: The parameter \"Password\" is being removed in a future release in favor of a new PSCredential parameter (-Credential).")]
4547
public string Password { get; set; }
4648

4749
public override void ExecuteApiManagementCmdlet()
@@ -50,8 +52,10 @@ public override void ExecuteApiManagementCmdlet()
5052
new PsApiManagementBackendProxy
5153
{
5254
Url = Url,
55+
#pragma warning disable 0618
5356
UserName = UserName,
5457
Password = Password
58+
#pragma warning restore 0618
5559
});
5660
}
5761
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public class NewAzureApiManagementUser : AzureApiManagementCmdletBase
6161
Mandatory = true,
6262
HelpMessage = "User password. This parameter is required.")]
6363
[ValidateNotNullOrEmpty]
64+
[Obsolete("New-AzureRmApiManagementUser: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
6465
public String Password { get; set; }
6566

6667
[Parameter(
@@ -79,7 +80,9 @@ public override void ExecuteApiManagementCmdlet()
7980
{
8081
string userId = UserId ?? Guid.NewGuid().ToString("N");
8182

83+
#pragma warning disable 0618
8284
var user = Client.UserCreate(Context, userId, FirstName, LastName, Password, Email, State, Note);
85+
#pragma warning restore 0618
8386

8487
WriteObject(user);
8588
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class SetAzureApiManagementUser : AzureApiManagementCmdletBase
5858
ValueFromPipelineByPropertyName = true,
5959
Mandatory = false,
6060
HelpMessage = "User password. This parameter is optional.")]
61+
[Obsolete("Set-AzureRmApiManagementUser: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
6162
public String Password { get; set; }
6263

6364
[Parameter(
@@ -82,7 +83,9 @@ public class SetAzureApiManagementUser : AzureApiManagementCmdletBase
8283

8384
public override void ExecuteApiManagementCmdlet()
8485
{
86+
#pragma warning disable 0618
8587
Client.UserSet(Context, UserId, FirstName, LastName, Password, Email, State, Note);
88+
#pragma warning restore 0618
8689

8790
if (PassThru)
8891
{

src/ResourceManager/ApiManagement/documentation/upcoming-breaking-changes.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,42 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+
30+
The following cmdlets were affected this release:
31+
32+
**New-AzureRmApiManagementBackendProxy**
33+
- Parameters "UserName" and "Password" are being replaced in favor of a PSCredential
34+
35+
```powershell
36+
37+
# Old
38+
# New-AzureRmApiManagementBackendProxy [other required parameters] -UserName "plain-text string" -Password "plain-text string"
39+
40+
# New
41+
# New-AzureRmApiManagementBackendProxy [other required parameters] -Credential $PSCredentialVariable
42+
```
43+
44+
**New-AzureRmApiManagementUser**
45+
- Parameter "Password" being replaced in favor of a SecureString
46+
47+
```powershell
48+
49+
# Old
50+
# New-AzureRmApiManagementUser [other required parameters] -Password "plain-text string"
51+
52+
# New
53+
# New-AzureRmApiManagementUser [other required parameters] -Password $SecureStringVariable
54+
```
55+
56+
**Set-AzureRmApiManagementUser**
57+
- Parameter "Password" being replaced in favor of a SecureString
58+
59+
```powershell
60+
61+
# Old
62+
# Set-AzureRmApiManagementUser [other required parameters] -Password "plain-text string"
63+
64+
# New
65+
# Set-AzureRmApiManagementUser [other required parameters] -Password $SecureStringVariable
66+
```

src/ResourceManager/AzureBatch/Commands.Batch/Certificates/NewBatchCertificateCommand.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Batch.Models;
16+
using System;
1617
using System.Management.Automation;
1718
using Constants = Microsoft.Azure.Commands.Batch.Utils.Constants;
1819

@@ -36,14 +37,17 @@ public class NewBatchCertificateCommand : BatchObjectModelCmdletBase
3637

3738
[Parameter]
3839
[ValidateNotNullOrEmpty]
40+
[Obsolete("New-AzureRmBatchCertificate: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
3941
public string Password { get; set; }
4042

4143
public override void ExecuteCmdlet()
4244
{
4345
NewCertificateParameters parameters = new NewCertificateParameters(this.BatchContext, this.FilePath, this.RawData,
4446
this.AdditionalBehaviors)
4547
{
48+
#pragma warning disable 0618
4649
Password = this.Password
50+
#pragma warning restore 0618
4751
};
4852

4953
BatchClient.AddCertificate(parameters);

src/ResourceManager/AzureBatch/Commands.Batch/ComputeNodeUsers/NewBatchComputeNodeUserCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class NewBatchComputeNodeUserCommand : BatchObjectModelCmdletBase
4444

4545
[Parameter(Mandatory = true, HelpMessage = "The account password.")]
4646
[ValidateNotNullOrEmpty]
47+
[Obsolete("New-AzureRmBatchComputeNodeUser: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
4748
public string Password { get; set; }
4849

4950
[Parameter]
@@ -59,7 +60,9 @@ public override void ExecuteCmdlet()
5960
this.ComputeNode, this.AdditionalBehaviors)
6061
{
6162
ComputeNodeUserName = this.Name,
63+
#pragma warning disable 0618
6264
Password = this.Password,
65+
#pragma warning restore 0618
6366
ExpiryTime = this.ExpiryTime,
6467
IsAdmin = this.IsAdmin.IsPresent
6568
};

src/ResourceManager/AzureBatch/Commands.Batch/ComputeNodeUsers/SetBatchComputeNodeUserCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class SetBatchComputeNodeUserCommand : BatchObjectModelCmdletBase
3939

4040
[Parameter(Position = 3, Mandatory = true, HelpMessage = "The account password.")]
4141
[ValidateNotNullOrEmpty]
42+
[Obsolete("Set-AzureRmBatchComputeNodeUser: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
4243
public string Password { get; set; }
4344

4445
[Parameter]
@@ -50,7 +51,9 @@ public override void ExecuteCmdlet()
5051
UpdateComputeNodeUserParameters parameters = new UpdateComputeNodeUserParameters(this.BatchContext,
5152
this.PoolId, this.ComputeNodeId, this.Name, this.AdditionalBehaviors)
5253
{
54+
#pragma warning disable 0618
5355
Password = this.Password,
56+
#pragma warning restore 0618
5457
ExpiryTime = this.ExpiryTime
5558
};
5659
this.BatchClient.UpdateComputeNodeUser(parameters);

src/ResourceManager/AzureBatch/documentation/upcoming-breaking-changes.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,44 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+
30+
## Release 5.0.0 - November 2017
31+
32+
The following cmdlets were affected this release:
33+
34+
**New-AzureRmBatchCertificate**
35+
- Parameter "Password" being replaced in favor of a Secure string
36+
37+
```powershell
38+
39+
# Old
40+
# New-AzureRmBatchCertificate [other required parameters] -Password "plain-text string"
41+
42+
# New
43+
# New-AzureRmBatchCertificate [other required parameters] -Password $SecureStringVariable
44+
```
45+
46+
**New-AzureRmBatchComputeNodeUser**
47+
- Parameter "Password" being replaced in favor of a Secure string
48+
49+
```powershell
50+
51+
# Old
52+
# New-AzureRmBatchComputeNodeUser [other required parameters] -Password "plain-text string"
53+
54+
# New
55+
# New-AzureRmBatchComputeNodeUser [other required parameters] -Password $SecureStringVariable
56+
```
57+
58+
**Set-AzureRmBatchComputeNodeUser**
59+
- Parameter "Password" being replaced in favor of a Secure string
60+
61+
```powershell
62+
63+
# Old
64+
# Set-AzureRmBatchComputeNodeUser [other required parameters] -Password "plain-text string"
65+
66+
# New
67+
# Set-AzureRmBatchComputeNodeUser [other required parameters] -Password $SecureStringVariable
68+
```

src/ResourceManager/Compute/Commands.Compute/Extension/VMAccess/SetAzureVMAccessExtension.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.Azure.Commands.Compute.Common;
1717
using Microsoft.Azure.Commands.Compute.Models;
1818
using Microsoft.Azure.Management.Compute.Models;
19+
using System;
1920
using System.Collections;
2021
using System.Management.Automation;
2122

@@ -35,12 +36,14 @@ public class SetAzureVMAccessExtensionCommand : SetAzureVMExtensionBaseCmdlet
3536
Mandatory = false,
3637
ValueFromPipelineByPropertyName = true,
3738
HelpMessage = "New or Existing User Name")]
39+
[Obsolete("Set-AzureRmVMAccessExtension: The parameter \"UserName\" is being removed in a future release in favor of a new PSCredential parameter (-Credential).")]
3840
public string UserName { get; set; }
3941

4042
[Parameter(
4143
Mandatory = false,
4244
ValueFromPipelineByPropertyName = true,
4345
HelpMessage = "New or Existing User Password")]
46+
[Obsolete("Set-AzureRmVMAccessExtension: The parameter \"Password\" is being removed in a future release in favor of a new PSCredential parameter (-Credential).")]
4447
public string Password { get; set; }
4548

4649
public override void ExecuteCmdlet()

src/ResourceManager/Compute/documentation/upcoming-breaking-changes.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,20 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+
30+
## Release 5.0.0 - November 2017
31+
32+
The following cmdlets were affected this release:
33+
34+
**Set-AzureRmVMAccessExtension**
35+
- Parameters "UserName" and "Password" are being replaced in favor of a PSCredential
36+
37+
```powershell
38+
39+
# Old
40+
# Set-AzureRmVMAccessExtension [other required parameters] -UserName "plain-text string" -Password "plain-text string"
41+
42+
# New
43+
# Set-AzureRmVMAccessExtension [other required parameters] -Credential $PSCredential
44+
```

src/ResourceManager/Network/Commands.Network/ApplicationGateway/SslCertificate/AzureApplicationGatewaySslCertificateBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class AzureApplicationGatewaySslCertificateBase : NetworkBaseCmdlet
3838
Mandatory = true,
3939
HelpMessage = "Certificate password")]
4040
[ValidateNotNullOrEmpty]
41+
[Obsolete("(Get/Set/New)-AzureRmApplicationGatewaySslCertificate: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
4142
public string Password { get; set; }
4243

4344
public PSApplicationGatewaySslCertificate NewObject()
@@ -46,7 +47,9 @@ public PSApplicationGatewaySslCertificate NewObject()
4647

4748
sslCertificate.Name = this.Name;
4849
sslCertificate.Data = Convert.ToBase64String(File.ReadAllBytes(CertificateFile));
50+
#pragma warning disable 0618
4951
sslCertificate.Password = this.Password;
52+
#pragma warning restore 0618
5053
sslCertificate.Id =
5154
ApplicationGatewayChildResourceHelper.GetResourceNotSetId(
5255
this.NetworkClient.NetworkManagementClient.SubscriptionId,

src/ResourceManager/Network/Commands.Network/ApplicationGateway/SslCertificate/SetAzureApplicationGatewaySslCertificateCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public override void ExecuteCmdlet()
4040
throw new ArgumentException("Ssl certificate with the specified name does not exist");
4141
}
4242

43+
#pragma warning disable 0618
4344
X509Certificate2 cert = new X509Certificate2(CertificateFile, Password, X509KeyStorageFlags.Exportable);
45+
#pragma warning restore 0618
4446

4547
var newSslCertificate = base.NewObject();
4648

src/ResourceManager/Network/documentation/upcoming-breaking-changes.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+
30+
The following cmdlets were affected this release:
31+
32+
**(Get/Set/New)-AzureRmApplicationGatewaySslCertificate**
33+
- Parameter "Password" being replaced in favor of a SecureString
34+
35+
```powershell
36+
37+
# Old
38+
# (Get/Set/New)-AzureRmApplicationGatewaySslCertificate [other required parameters] -Password "plain-text string"
39+
40+
# New
41+
# (Get/Set/New)-AzureRmApplicationGatewaySslCertificate [other required parameters] -Password $SecureStringVariable
42+
```

src/ResourceManager/Resources/Commands.Resources/ActiveDirectory/NewAzureADAppCredentialCommand.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class NewAzureADAppCredentialCommand : ActiveDirectoryBaseCmdlet
4040
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationIdWithPassword,
4141
HelpMessage = "The value for the password credential associated with the application that will be valid for one year by default.")]
4242
[ValidateNotNullOrEmpty]
43+
[Obsolete("New-AzureRmADAppCredential: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
4344
public string Password { get; set; }
4445

4546
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationObjectIdWithCertValue,
@@ -71,16 +72,19 @@ public override void ExecuteCmdlet()
7172
ObjectId = ActiveDirectoryClient.GetObjectIdFromApplicationId(ApplicationId);
7273
}
7374

74-
75+
#pragma warning disable 0618
7576
if (!string.IsNullOrEmpty(Password))
77+
#pragma warning restore 0618
7678
{
7779
// Create object for password credential
7880
var passwordCredential = new PasswordCredential()
7981
{
8082
EndDate = EndDate,
8183
StartDate = StartDate,
8284
KeyId = Guid.NewGuid().ToString(),
85+
#pragma warning disable 0618
8386
Value = Password
87+
#pragma warning restore 0618
8488
};
8589
if (ShouldProcess(target: ObjectId, action: string.Format("Adding a new password to application with objectId {0}", ObjectId)))
8690
{

src/ResourceManager/Resources/Commands.Resources/ActiveDirectory/NewAzureADApplicationCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public class NewAzureADApplicationCommand : ActiveDirectoryBaseCmdlet
9999
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationWithPasswordPlain,
100100
HelpMessage = "The value for the password credential associated with the application that will be valid for one year by default.")]
101101
[ValidateNotNullOrEmpty]
102+
[Obsolete("New-AzureRmADApplication: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
102103
public string Password { get; set; }
103104

104105
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationWithKeyPlain,
@@ -146,7 +147,9 @@ public override void ExecuteCmdlet()
146147
StartDate = StartDate,
147148
EndDate = EndDate,
148149
KeyId = Guid.NewGuid(),
150+
#pragma warning disable 0618
149151
Password = Password
152+
#pragma warning restore 0618
150153
}
151154
};
152155
break;

src/ResourceManager/Resources/Commands.Resources/ActiveDirectory/NewAzureADServicePrincipalCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public class NewAzureADServicePrincipalCommand : ActiveDirectoryBaseCmdlet
6666
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.DisplayNameWithPasswordPlain,
6767
HelpMessage = "The value for the password credential associated with the application that will be valid for one year by default.")]
6868
[ValidateNotNullOrEmpty]
69+
[Obsolete("New-AzureRmADServicePrincipal: The parameter \"Password\" is being changed from a string to a SecureString in an upcoming breaking change release.")]
6970
public string Password { get; set; }
7071

7172
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ApplicationWithKeyPlain,
@@ -142,7 +143,9 @@ public override void ExecuteCmdlet()
142143
StartDate = StartDate,
143144
EndDate = EndDate,
144145
KeyId = Guid.NewGuid(),
146+
#pragma warning disable 0618
145147
Password = Password
148+
#pragma warning restore 0618
146149
}
147150
};
148151
break;

0 commit comments

Comments
 (0)