Skip to content

Commit 5a99b97

Browse files
committed
Rename the "windowsCredential" to "Crendential" in New-AzureDataFactoryEncryptValue, and update the description of this parameter in the help content according to the latest string from UE
1 parent cb72d0e commit 5a99b97

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryEncryptValueTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void TestOnPremDatasourceEncryptionWinAuth()
6666
string expectedOutput = "My encrypted string " + Guid.NewGuid();
6767
string winAuthUserName = "foo";
6868
SecureString winAuthPassword = new SecureString();
69-
PSCredential windowsCredential = new PSCredential(winAuthUserName, winAuthPassword);
69+
PSCredential credential = new PSCredential(winAuthUserName, winAuthPassword);
7070

7171
var cmdlet = new NewAzureDataFactoryEncryptValueCommand
7272
{
@@ -76,17 +76,17 @@ public void TestOnPremDatasourceEncryptionWinAuth()
7676
ResourceGroupName = ResourceGroupName,
7777
DataFactoryName = DataFactoryName,
7878
GatewayName = GatewayName,
79-
WindowsCredential = windowsCredential
79+
Credential = credential
8080
};
8181

8282
// Arrange
83-
this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, windowsCredential)).Returns(expectedOutput);
83+
this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential)).Returns(expectedOutput);
8484

8585
// Action
8686
cmdlet.ExecuteCmdlet();
8787

8888
// Assert
89-
this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, windowsCredential), Times.Once());
89+
this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential), Times.Once());
9090
this.commandRuntimeMock.Verify(f => f.WriteObject(expectedOutput), Times.Once());
9191
}
9292
}

src/ResourceManager/DataFactories/Commands.DataFactories/Encrypt/NewAzureDataFactoryEncryptValueCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class NewAzureDataFactoryEncryptValueCommand : DataFactoryBaseCmdlet
4545

4646
[Parameter(ParameterSetName = ByFactoryObject, Position = 3, Mandatory = false, HelpMessage = "The windows authentication credential.")]
4747
[Parameter(ParameterSetName = ByFactoryName, Position = 4, Mandatory = false, HelpMessage = "The windows authentication credential.")]
48-
public PSCredential WindowsCredential { get; set; }
48+
public PSCredential Credential { get; set; }
4949

5050
[EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)]
5151
public override void ExecuteCmdlet()
@@ -72,7 +72,7 @@ public override void ExecuteCmdlet()
7272
else
7373
{
7474
// On-premises encryption with Gateway
75-
encryptedValue = DataFactoryClient.OnPremisesEncryptString(Value, ResourceGroupName, DataFactoryName, GatewayName, WindowsCredential);
75+
encryptedValue = DataFactoryClient.OnPremisesEncryptString(Value, ResourceGroupName, DataFactoryName, GatewayName, Credential);
7676
}
7777

7878
WriteObject(encryptedValue);

src/ResourceManager/DataFactories/Commands.DataFactories/Microsoft.Azure.Commands.DataFactories.dll-Help.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,9 +2082,9 @@
20822082
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
20832083
</command:parameter>
20842084
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="4" aliases="">
2085-
<maml:name>WindowsCredential</maml:name>
2085+
<maml:name>Credential</maml:name>
20862086
<maml:description>
2087-
<maml:para>Specifies the windows authentication credential user name and password. This cmdlet encrypts the credential data that this parameter specifies.</maml:para>
2087+
<maml:para>Specifies the Windows authentication credentials (user name and password) to be used. This cmdlet encrypts the credential data you specify here.</maml:para>
20882088
</maml:description>
20892089
<command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
20902090
</command:parameter>
@@ -2120,9 +2120,9 @@
21202120
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
21212121
</command:parameter>
21222122
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="5" aliases="">
2123-
<maml:name>WindowsCredential</maml:name>
2123+
<maml:name>Credential</maml:name>
21242124
<maml:description>
2125-
<maml:para>Specifies the windows authentication credential user name and password. This cmdlet encrypts the credential data that this parameter specifies.</maml:para>
2125+
<maml:para>Specifies the Windows authentication credentials (user name and password) to be used. This cmdlet encrypts the credential data you specify here.</maml:para>
21262126
</maml:description>
21272127
<command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
21282128
</command:parameter>
@@ -2190,9 +2190,9 @@
21902190
<dev:defaultValue></dev:defaultValue>
21912191
</command:parameter>
21922192
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="5" aliases="">
2193-
<maml:name>WindowsCredential</maml:name>
2193+
<maml:name>Credential</maml:name>
21942194
<maml:description>
2195-
<maml:para>Specifies the windows authentication credential user name and password. This cmdlet encrypts the credential data that this parameter specifies.</maml:para>
2195+
<maml:para>Specifies the Windows authentication credentials (user name and password) to be used. This cmdlet encrypts the credential data you specify here.</maml:para>
21962196
</maml:description>
21972197
<command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue>
21982198
<dev:type>
@@ -2277,7 +2277,7 @@
22772277
<dev:code>
22782278
PS C:\&gt; $Value = ConvertTo-SecureString "Data Source=ContosoServer;Initial Catalog=catelog;Integrated Security=True" -AsPlainText -Force
22792279
PS C:\&gt; $Credential = Get-Credential
2280-
PS C:\&gt; New-AzureDataFactoryEncryptValue -DataFactoryName "UncycloADF" -GatewayName "UncycloGateway" -ResourceGroupName "ADF" -Value $Value -WindowsCredential $Credential
2280+
PS C:\&gt; New-AzureDataFactoryEncryptValue -DataFactoryName "UncycloADF" -GatewayName "UncycloGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential
22812281
data source=ContosoServer;initial catalog=catelog;EncryptedCredential=KAAAAAABAAAQAAAAQUU5MUVBNzY4QkFCQkI3MEUwRTMxOUNFNkM0MjRDOTVDNDk3RTcyRi8XAXyE/H+f3JydTkdg5t2g1eC/VtyF3NAD3idYnhrAphPJmO0pCaG5nH2IY48L3XJi7wabrlrGF+ieiWh1bwdgdxrW+t2jWPnLvT/ENUXtcevpx/dmTGKagH8TU9HLcoL1CAanb7Vkpga1B/uzRxBnVdsdtfvBzxG2M810tj1WzL8lFzA1mO5GbB0+ge116y0scL1vxjerjl5Muv0r0scG3lhj+IF0sXUMITFvhQwOIqweR052E6JlfJu+mTNFLCCkpw1iV+rhRhKqJF752dBuWjzI1EoyQUE17oK4OevkquuhUbfJmzj9BhGKQ+VkndAZiSw19FEGSC7JzoUe/XWEs/FJYrQCCXIeNS94J9/VzN6KPYJR1pzAYCtnhq+p8Q==
22822282
</dev:code>
22832283
<dev:remarks>

src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Encrypt.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public virtual string CloudEncryptString(SecureString value, string resourceGrou
3333
resourceGroupName, dataFactoryName);
3434
}
3535

36-
public virtual string OnPremisesEncryptString(SecureString value, string resourceGroupName, string dataFactoryName, string gatewayName, PSCredential windowsCredential)
36+
public virtual string OnPremisesEncryptString(SecureString value, string resourceGroupName, string dataFactoryName, string gatewayName, PSCredential credential)
3737
{
3838
if (value == null)
3939
{
@@ -52,8 +52,8 @@ public virtual string OnPremisesEncryptString(SecureString value, string resourc
5252
}
5353
};
5454

55-
string userName = windowsCredential != null ? windowsCredential.UserName : null;
56-
SecureString password = windowsCredential != null ? windowsCredential.Password : null;
55+
string userName = credential != null ? credential.UserName : null;
56+
SecureString password = credential != null ? credential.Password : null;
5757
UserInputConnectionString connectionString = new UserInputConnectionString(value, userName, password);
5858
var gatewayEncryptionClient = new GatewayEncryptionClient();
5959
return gatewayEncryptionClient.Encrypt(connectionString, gatewayEncryptionInfos);

0 commit comments

Comments
 (0)