Skip to content

Commit 3ac09fc

Browse files
author
Hovsep Mkrtchyan
committed
fixed Compute.csproj
1 parent 05516e5 commit 3ac09fc

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
<Compile Include="Common\ComputeCloudException.cs" />
154154
<Compile Include="Common\DiagnosticsHelper.cs" />
155155
<Compile Include="Common\StorageManagementClient.cs" />
156-
<Compile Include="Common\StrategyClient.cs" />
157156
<Compile Include="ExtensionImages\GetAzureVMExtensionImageTypeCommand.cs" />
158157
<Compile Include="ExtensionImages\GetAzureVMExtensionImageCommand.cs" />
159158
<Compile Include="ExtensionImages\VirtualMachineExtensionImageBaseCmdlet.cs" />

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetCreateOrUpdateMethod.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
using Microsoft.Azure.Commands.Common.Strategies.Network;
3636
using Microsoft.Azure.Commands.Compute.Common;
3737
using System.Net;
38+
using Microsoft.Azure.Commands.Compute.Strategies;
39+
using System.Threading.Tasks;
3840

3941
namespace Microsoft.Azure.Commands.Compute.Automation
4042
{
@@ -130,7 +132,7 @@ protected override void ProcessRecord()
130132
switch (ParameterSetName)
131133
{
132134
case SimpleParameterSet:
133-
SimpleParameterSetExecuteCmdlet();
135+
this.StartAndWait(SimpleParameterSetExecuteCmdlet);
134136
break;
135137
default:
136138
ExecuteClientAction(() =>
@@ -152,13 +154,9 @@ protected override void ProcessRecord()
152154
}
153155
}
154156

155-
public void SimpleParameterSetExecuteCmdlet()
157+
async Task SimpleParameterSetExecuteCmdlet(IAsyncCmdlet asyncCmdlet)
156158
{
157159
ResourceGroupName = ResourceGroupName ?? VMScaleSetName;
158-
InstanceCount = InstanceCount ?? 2;
159-
VmSku = VmSku ?? "Standard_DS2";
160-
UpgradePolicyMode = UpgradePolicyMode ?? UpgradeMode.Automatic;
161-
162160
VirtualNetworkName = VirtualNetworkName ?? VMScaleSetName;
163161
SubnetName = SubnetName ?? VMScaleSetName;
164162
PublicIpAddressName = PublicIpAddressName ?? VMScaleSetName;
@@ -225,16 +223,15 @@ public void SimpleParameterSetExecuteCmdlet()
225223

226224
if (ShouldProcess(VMScaleSetName, VerbsCommon.New))
227225
{
228-
var result = virtualMachineScaleSet
226+
var result = await virtualMachineScaleSet
229227
.UpdateStateAsync(
230228
client,
231229
target,
232230
new CancellationToken(),
233-
new ShouldProcessType(this),
234-
new ProgressReportType(this))
235-
.GetAwaiter()
236-
.GetResult();
237-
WriteObject(result);
231+
new ShouldProcess(asyncCmdlet),
232+
new ProgressReport(asyncCmdlet));
233+
234+
asyncCmdlet.WriteObject(result);
238235
}
239236
}
240237

@@ -282,7 +279,7 @@ public void SimpleParameterSetExecuteCmdlet()
282279
public PSCredential Credential { get; set; }
283280

284281
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
285-
public int? InstanceCount { get; set; }
282+
public int InstanceCount { get; set; } = 2;
286283

287284
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
288285
public string VirtualNetworkName { get; set; }
@@ -308,12 +305,13 @@ public void SimpleParameterSetExecuteCmdlet()
308305
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
309306
[LocationCompleter]
310307
public string Location { get; set; }
311-
308+
309+
// this corresponds to VmSku in the Azure CLI
312310
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
313-
public string VmSku { get; set; }
311+
public string VmSize { get; set; } = "Standard_DS1_v2";
314312

315313
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
316-
public UpgradeMode? UpgradePolicyMode { get; set; }
314+
public UpgradeMode UpgradePolicyMode { get; set; }
317315

318316
[Parameter(ParameterSetName = SimpleParameterSet, Mandatory = false)]
319317
[ValidateSet("Static", "Dynamic")]

0 commit comments

Comments
 (0)