Skip to content

Commit 64f67d8

Browse files
committed
Regenerate and support latest Azure Batch SDK
- Add support for Azure Batch SDK 8.0. - Includes one new cmdlet (Get-AzureBatchTaskCounts) and a number of cmdlet updates. - Re-record tests. - Regenerate help text. - Use secure string for password fields.
1 parent bbd4e65 commit 64f67d8

File tree

131 files changed

+7666
-4474
lines changed

Some content is hidden

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

131 files changed

+7666
-4474
lines changed

src/ResourceManager/AzureBatch/AzureRM.Batch.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ CmdletsToExport = 'Remove-AzureRmBatchAccount', 'Get-AzureRmBatchAccount',
106106
'New-AzureBatchComputeNodeUser', 'Remove-AzureBatchComputeNodeUser',
107107
'Enable-AzureBatchTask', 'Set-AzureBatchTask', 'Stop-AzureBatchTask',
108108
'Get-AzureBatchComputeNode', 'Get-AzureBatchJobSchedule',
109-
'New-AzureBatchJobSchedule', 'Remove-AzureBatchJobSchedule'
109+
'New-AzureBatchJobSchedule', 'Remove-AzureBatchJobSchedule',
110+
'Get-AzureBatchTaskCounts'
110111

111112
# Variables to export from this module
112113
# VariablesToExport = @()

src/ResourceManager/AzureBatch/BatchModelGenerator/Program.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ public class Program
4646
{"Microsoft.Azure.Batch.CloudTask", "PSCloudTask"},
4747
{"Microsoft.Azure.Batch.CloudServiceConfiguration", "PSCloudServiceConfiguration"},
4848
{"Microsoft.Azure.Batch.ComputeNode", "PSComputeNode"},
49+
{"Microsoft.Azure.Batch.ComputeNodeEndpointConfiguration", "PSComputeNodeEndpointConfiguration"},
4950
{"Microsoft.Azure.Batch.ComputeNodeError", "PSComputeNodeError"},
5051
{"Microsoft.Azure.Batch.ComputeNodeInformation", "PSComputeNodeInformation"},
5152
{"Microsoft.Azure.Batch.ComputeNodeUser", "PSComputeNodeUser"},
53+
{"Microsoft.Azure.Batch.ContainerConfiguration", "PSContainerConfiguration"},
54+
{"Microsoft.Azure.Batch.ContainerRegistry", "PSContainerRegistry"},
55+
{"Microsoft.Azure.Batch.DataDisk", "PSDataDisk"},
5256
{"Microsoft.Azure.Batch.DeleteCertificateError", "PSDeleteCertificateError"},
5357
{"Microsoft.Azure.Batch.EnvironmentSetting", "PSEnvironmentSetting"},
5458
{"Microsoft.Azure.Batch.ExitConditions", "PSExitConditions"},
@@ -57,6 +61,8 @@ public class Program
5761
{"Microsoft.Azure.Batch.ExitOptions", "PSExitOptions"},
5862
{"Microsoft.Azure.Batch.FileProperties", "PSFileProperties"},
5963
{"Microsoft.Azure.Batch.ImageReference", "PSImageReference"},
64+
{"Microsoft.Azure.Batch.InboundEndpoint", "PSInboundEndpoint"},
65+
{"Microsoft.Azure.Batch.InboundNatPool", "PSInboundNatPool"},
6066
{"Microsoft.Azure.Batch.RemoteLoginSettings", "PSRemoteLoginSettings"},
6167
{"Microsoft.Azure.Batch.JobConstraints", "PSJobConstraints"},
6268
{"Microsoft.Azure.Batch.JobExecutionInformation", "PSJobExecutionInformation"},
@@ -71,13 +77,20 @@ public class Program
7177
{"Microsoft.Azure.Batch.JobSchedulingError", "PSJobSchedulingError"},
7278
{"Microsoft.Azure.Batch.JobSpecification", "PSJobSpecification"},
7379
{"Microsoft.Azure.Batch.JobStatistics", "PSJobStatistics"},
80+
{"Microsoft.Azure.Batch.LinuxUserConfiguration", "PSLinuxUserConfiguration"},
7481
{"Microsoft.Azure.Batch.MetadataItem", "PSMetadataItem"},
7582
{"Microsoft.Azure.Batch.MultiInstanceSettings", "PSMultiInstanceSettings"},
7683
{"Microsoft.Azure.Batch.NameValuePair", "PSNameValuePair"},
7784
{"Microsoft.Azure.Batch.NetworkConfiguration", "PSNetworkConfiguration"},
85+
{"Microsoft.Azure.Batch.NetworkSecurityGroupRule", "PSNetworkSecurityGroupRule"},
7886
{"Microsoft.Azure.Batch.NodeAgentSku", "PSNodeAgentSku"},
7987
{"Microsoft.Azure.Batch.NodeFile", "PSNodeFile"},
8088
{"Microsoft.Azure.Batch.OSDisk", "PSOSDisk"},
89+
{"Microsoft.Azure.Batch.OutputFile", "PSOutputFile"},
90+
{"Microsoft.Azure.Batch.OutputFileDestination", "PSOutputFileDestination"},
91+
{"Microsoft.Azure.Batch.OutputFileUploadOptions", "PSOutputFileUploadOptions"},
92+
{"Microsoft.Azure.Batch.OutputFileBlobContainerDestination", "PSOutputFileBlobContainerDestination"},
93+
{"Microsoft.Azure.Batch.PoolEndpointConfiguration", "PSPoolEndpointConfiguration"},
8194
{"Microsoft.Azure.Batch.PoolInformation", "PSPoolInformation"},
8295
{"Microsoft.Azure.Batch.PoolSpecification", "PSPoolSpecification"},
8396
{"Microsoft.Azure.Batch.PoolStatistics", "PSPoolStatistics"},
@@ -91,11 +104,14 @@ public class Program
91104
{"Microsoft.Azure.Batch.StartTaskInformation", "PSStartTaskInformation"},
92105
{"Microsoft.Azure.Batch.SubtaskInformation", "PSSubtaskInformation"},
93106
{"Microsoft.Azure.Batch.TaskConstraints", "PSTaskConstraints"},
107+
{"Microsoft.Azure.Batch.TaskContainerExecutionInformation", "PSTaskContainerExecutionInformation"},
108+
{"Microsoft.Azure.Batch.TaskContainerSettings", "PSTaskContainerSettings"},
109+
{"Microsoft.Azure.Batch.TaskCounts", "PSTaskCounts"},
94110
{"Microsoft.Azure.Batch.TaskDependencies", "PSTaskDependencies"},
95111
{"Microsoft.Azure.Batch.TaskExecutionInformation", "PSTaskExecutionInformation"},
96112
{"Microsoft.Azure.Batch.TaskInformation", "PSTaskInformation"},
97113
{"Microsoft.Azure.Batch.TaskIdRange", "PSTaskIdRange"},
98-
{"Microsoft.Azure.Batch.TaskSchedulingError", "PSTaskSchedulingError"},
114+
{"Microsoft.Azure.Batch.TaskFailureInformation", "PSTaskFailureInformation"},
99115
{"Microsoft.Azure.Batch.TaskSchedulingPolicy", "PSTaskSchedulingPolicy"},
100116
{"Microsoft.Azure.Batch.TaskStatistics", "PSTaskStatistics"},
101117
{"Microsoft.Azure.Batch.UsageStatistics", "PSUsageStatistics"},

src/ResourceManager/AzureBatch/ChangeLog.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,51 @@
2727
- $autoUser = New-Object Microsoft.Azure.Commands.Batch.Models.PSAutoUserSpecification -ArgumentList @("Task", "Admin")
2828
- $userIdentity = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserIdentity $autoUser
2929
- Added the `AuthenticationTokenSettings` parameter. This parameter allows you to request the Batch service provide an authentication token to the task when it runs, avoiding the need to pass Batch account keys to the task in order to issue requests to the Batch service.
30-
* Added the `UserAccounts` parameter to `New-AzureBatchPool`.
31-
- This parameter defines user accounts created on each node in the pool.
30+
- Added the `ContainerSettings` parameter.
31+
- This parameter allows you to request the Batch service run the task inside a container.
32+
- Added the `OutputFiles` parameter.
33+
- This parameter allows you to configure the task to upload files to Azure Storage after it has finished.
34+
* Updated parameters to `New-AzureBatchPool`.
35+
- Added the `UserAccounts` parameter.
36+
- This parameter defines user accounts created on each node in the pool.
37+
- Added `TargetLowPriorityComputeNodes` and renamed `TargetDedicated` to `TargetDedicatedComputeNodes`.
38+
- A `TargetDedicated` alias was created for the `TargetDedicatedComputeNodes` parameter.
39+
- Added the `NetworkConfiguration` parameter.
40+
- This parameter allows you to configure the pools network settings.
41+
* Updated parameters to `New-AzureBatchCertificate`.
42+
- The `Password` parameter is now a `SecureString`.
43+
* Updated parameters to `New-AzureBatchComputeNodeUser`.
44+
- The `Password` parameter is now a `SecureString`.
45+
* Updated parameters to `Set-AzureBatchComputeNodeUser`.
46+
- The `Password` parameter is now a `SecureString`.
3247
* Renamed the `Name` parameter to `Path` on `Get-AzureBatchNodeFile`, `Get-AzureBatchNodeFileContent`, and `Remove-AzureBatchNodeFile`.
3348
- A `Name` alias was created for the `Path` parameter.
3449
* Changes to objects:
3550
- Removed the `RunElevated` property on `PSCloudTask`, `PSStartTask`, `PSJobManagerTask`, `PSJobPreparationTask`, and `PSJobReleaseTask`. The `UserIdentity` property has been added to replace `RunElevated`. Equivalent behavior to `RunElevated = $true` can be achieved by constructing a `PSUserIdentity` as shown below:
3651
- $autoUser = New-Object Microsoft.Azure.Commands.Batch.Models.PSAutoUserSpecification -ArgumentList @("Task", "Admin")
3752
- $userIdentity = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserIdentity $autoUser
3853
- Added the `AuthenticationTokenSettings` property to `PSCloudTask` and `PSJobManagerTask`.
54+
- Added the `OutputFiles` property to `PSCloudTask`, and `PSJobManagerTask`.
55+
- Added the `ContainerSettings` property to `PSCloudTask`, `PSStartTask`, `PSJobManagerTask`, `PSJobPreparationTask`, and `PSJobReleaseTask`.
56+
- Added the `AllowLowPriorityNode` property to `PSJobManagerTask`.
57+
- Renamed the `SchedulingError` property on `PSJobPreparationTaskExecutionInformation`, `PSJobReleaseTaskExecutionInformation`, `PSStartTaskInformation`, `PSSubtaskInformation`, and `PSTaskExecutionInformation` to `FailureInformation`.
58+
- `FailureInformation` is returned any time there is a task failure. This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature.
59+
- Renamed `PSTaskSchedulingError` to `PSTaskFailureInformation`.
60+
- Added the `ContainerInformation` and `Result` properties to `PSJobPreparationTaskExecutionInformation`, `PSJobReleaseTaskExecutionInformation`, `PSStartTaskInformation`, `PSSubtaskInformation`, and `PSTaskExecutionInformation`.
3961
- Added the `UserAccounts` property to `PSCloudPool` and `PSPoolSpecification`.
62+
- Added the `TargetLowPriorityComputeNodes` property to `PSCloudPool` and `PSPoolSpecification`, and renamed `TargetDedicated` to `TargetDedicatedComputeNodes`.
4063
- Renamed the `Name` property on `PSNodeFile` to `Path`.
64+
- Added the `EndpointConfiguration` and `IsDedicated` property to `PSComputeNode`.
65+
- Renamed the `SchedulingError` property on `PSExitConditions` to `PreProcessingError`.
66+
- Added the `FileUploadError` to `PSExitConditions`.
4167
- Added the `DependencyAction` property to `PSExitOptions`.
42-
- Added the `OSDisk` property to `PSVirtualMachineConfiguration`. Note that in order to allow deploying nodes using custom VHDs, the Batch account being used must have been created with `PoolAllocationMode = UserSubscription`.
68+
- Added the `OSDisk`, `ContainerConfiguration`, `DataDisks`, and `LicenseType` properties to `PSVirtualMachineConfiguration`.
69+
- Added the `VirtualMachineImageId` property to `PSImageReference`. Note that in order to allow deploying nodes using custom VHDs, the `BatchAccountContext` must be using Azure Active Directory authentication.
70+
- Added the `OnAllTasksComplete` and `OnTaskFailure` properties to `PSJobSpecification`.
71+
- Added the `EndpointConfiguration` property to `PSNetworkConfiguration`.
72+
- Renamed `ResizeError` to `ResizeErrors` on `PSCloudPool`, and it is now a collection.
73+
- `PSMultiInstanceSettings` constructor no longer takes a required `numberOfInstances` parameter, instead it takes a required `coordinationCommandLine` parameter.
74+
4375
* Added support for Azure Active Directory based authentication.
4476
- To use Azure Active Directory authentication, retrieve a `BatchAccountContext` object using the `Get-AzureRmBatchAccount` cmdlet, and supply this `BatchAccountContext` to the `-BatchContext` parameter of a Batch service cmdlet. Azure Active Directory authentication is mandatory for accounts with `PoolAllocationMode = UserSubscription`.
4577
- For existing accounts or for new accounts created with `PoolAllocationMode = BatchService`, you may continue to use shared key authentication by retrieving a `BatchAccountContext` object using the `Get-AzureRmBatchAccoutKeys` cmdlet.

src/ResourceManager/AzureBatch/Commands.Batch.Test/BatchTestHelpers.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using System.Reflection;
2828
using System.Threading.Tasks;
2929
using Microsoft.Azure.Commands.Batch.Models;
30+
using Microsoft.Azure.Commands.Common.Authentication;
3031
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
3132
using Xunit;
3233
using ProxyModels = Microsoft.Azure.Batch.Protocol.Models;
@@ -689,6 +690,28 @@ public static AzureOperationResponse<
689690
return response;
690691
}
691692

693+
/// <summary>
694+
/// Builds a TaskCountsGetResponse object
695+
/// </summary>
696+
public static AzureOperationResponse<ProxyModels.TaskCounts, ProxyModels.JobGetTaskCountsHeaders> CreateTaskCountsGetResponse(
697+
int active, int running, int succeeded, int failed, ProxyModels.TaskCountValidationStatus validationStatus)
698+
{
699+
var response = new AzureOperationResponse<ProxyModels.TaskCounts, ProxyModels.JobGetTaskCountsHeaders>();
700+
response.Response = new HttpResponseMessage(HttpStatusCode.OK);
701+
702+
ProxyModels.TaskCounts taskCounts = new ProxyModels.TaskCounts();
703+
taskCounts.Active = active;
704+
taskCounts.Running = running;
705+
taskCounts.Succeeded = succeeded;
706+
taskCounts.Failed = failed;
707+
taskCounts.Completed = succeeded + failed;
708+
taskCounts.ValidationStatus = validationStatus;
709+
710+
response.Body = taskCounts;
711+
712+
return response;
713+
}
714+
692715
/// <summary>
693716
/// Builds a CloudTaskListResponse object
694717
/// </summary>

src/ResourceManager/AzureBatch/Commands.Batch.Test/Certificates/NewBatchCertificateCommandTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Management.Automation;
2525
using System.Security.Cryptography.X509Certificates;
2626
using System.Threading.Tasks;
27+
using Microsoft.WindowsAzure.Commands.Common;
2728
using Xunit;
2829
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2930

@@ -119,7 +120,7 @@ public void NewBatchCertificateRequestBodyTest()
119120

120121
// Verify that when the raw data is specified with a password, the request body matches expectations
121122
cmdlet.RawData = cert.RawData;
122-
cmdlet.Password = BatchTestHelpers.TestCertificatePassword;
123+
cmdlet.Password = BatchTestHelpers.TestCertificatePassword.ConvertToSecureString();
123124
cmdlet.ExecuteCmdlet();
124125
Assert.Equal(CertificateFormat.Pfx, requestParameters.CertificateFormat);
125126
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);
@@ -139,7 +140,7 @@ public void NewBatchCertificateRequestBodyTest()
139140
Assert.Equal(certDataBase64String, requestParameters.Data);
140141

141142
// Verify that when a file path is specified with a password, the request body matches expectations
142-
cmdlet.Password = BatchTestHelpers.TestCertificatePassword;
143+
cmdlet.Password = BatchTestHelpers.TestCertificatePassword.ConvertToSecureString();
143144
cmdlet.ExecuteCmdlet();
144145
Assert.Equal(CertificateFormat.Pfx, requestParameters.CertificateFormat);
145146
Assert.Equal(BatchTestHelpers.TestCertificateAlgorithm, requestParameters.ThumbprintAlgorithm);

src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
<Reference Include="Hyak.Common">
4545
<HintPath>..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
4646
</Reference>
47-
<Reference Include="Microsoft.Azure.Batch, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
48-
<HintPath>..\..\..\packages\Azure.Batch.6.1.0\lib\net45\Microsoft.Azure.Batch.dll</HintPath>
47+
<Reference Include="Microsoft.Azure.Batch, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
48+
<HintPath>..\..\..\packages\Azure.Batch.8.0.0\lib\net452\Microsoft.Azure.Batch.dll</HintPath>
4949
</Reference>
5050
<Reference Include="Microsoft.Azure.Common">
5151
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
@@ -98,12 +98,10 @@
9898
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
9999
</Reference>
100100
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
101-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.5\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
102-
<Private>True</Private>
101+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
103102
</Reference>
104103
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
105-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.5\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
106-
<Private>True</Private>
104+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
107105
</Reference>
108106
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
109107
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
@@ -262,6 +260,7 @@
262260
<Compile Include="ScenarioTests\JobScheduleTests.cs" />
263261
<Compile Include="Locations\GetBatchLocationQuotasCommandTests.cs" />
264262
<Compile Include="Tasks\GetBatchSubtaskCommandTests.cs" />
263+
<Compile Include="Tasks\GetBatchTaskCountsCommandTests.cs" />
265264
<Compile Include="Tasks\GetBatchTaskCommandTests.cs" />
266265
<Compile Include="Tasks\NewBatchTaskCommandTests.cs" />
267266
<Compile Include="Tasks\RemoveBatchTaskCommandTests.cs" />

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodeUsers/NewBatchComputeNodeUserCommandTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using System;
2121
using System.Collections.Generic;
2222
using System.Management.Automation;
23+
using Microsoft.WindowsAzure.Commands.Common;
2324
using Xunit;
2425
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2526
using ProxyModels = Microsoft.Azure.Batch.Protocol.Models;
@@ -57,7 +58,7 @@ public void NewBatchComputeNodeUserParametersTest()
5758
cmdlet.PoolId = "testPool";
5859
cmdlet.ComputeNodeId = "computeNode1";
5960
cmdlet.Name = "testUser";
60-
cmdlet.Password = "Password1234";
61+
cmdlet.Password = "Password1234".ConvertToSecureString();
6162

6263
// Don't go to the service on an Add ComputeNodeUser call
6364
RequestInterceptor interceptor = BatchTestHelpers.CreateFakeServiceResponseInterceptor<
@@ -81,7 +82,7 @@ public void NewBatchComputeNodeUserParametersGetPassedToRequestTest()
8182
cmdlet.PoolId = "testPool";
8283
cmdlet.ComputeNodeId = "computeNode1";
8384
cmdlet.Name = "user";
84-
cmdlet.Password = "password";
85+
cmdlet.Password = "password".ConvertToSecureString();
8586
cmdlet.IsAdmin = true;
8687
cmdlet.ExpiryTime = DateTime.Now.AddDays(30);
8788

@@ -101,7 +102,7 @@ public void NewBatchComputeNodeUserParametersGetPassedToRequestTest()
101102

102103
// Verify the request parameters match the cmdlet parameters
103104
Assert.Equal(cmdlet.Name, requestParameters.Name);
104-
Assert.Equal(cmdlet.Password, requestParameters.Password);
105+
Assert.Equal(cmdlet.Password.ConvertToString(), requestParameters.Password);
105106
Assert.Equal(cmdlet.IsAdmin, requestParameters.IsAdmin);
106107
Assert.Equal(cmdlet.ExpiryTime, requestParameters.ExpiryTime);
107108
}

src/ResourceManager/AzureBatch/Commands.Batch.Test/ComputeNodeUsers/SetBatchComputeNoderUserCommandTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System;
2222
using System.Collections.Generic;
2323
using System.Management.Automation;
24+
using Microsoft.WindowsAzure.Commands.Common;
2425
using Xunit;
2526
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
2627

@@ -82,7 +83,7 @@ public void SetBatchComputeNodeUserRequestTest()
8283
cmdlet.PoolId = "testPool";
8384
cmdlet.ComputeNodeId = "computeNode1";
8485
cmdlet.Name = "testUser";
85-
cmdlet.Password = "Password1234";
86+
cmdlet.Password = "Password1234".ConvertToSecureString();
8687
cmdlet.ExpiryTime = DateTime.Now.AddDays(1);
8788

8889
string requestPassword = null;
@@ -101,7 +102,7 @@ public void SetBatchComputeNodeUserRequestTest()
101102
cmdlet.ExecuteCmdlet();
102103

103104
// Verify the request parameters match expectations
104-
Assert.Equal(cmdlet.Password, requestPassword);
105+
Assert.Equal(cmdlet.Password.ConvertToString(), requestPassword);
105106
Assert.Equal(cmdlet.ExpiryTime, requestExpiryTime);
106107
}
107108
}

0 commit comments

Comments
 (0)