@@ -37,7 +37,7 @@ protected object CreateVirtualMachineScaleSetDeallocateInstancesDynamicParameter
37
37
dynamicParameters = new RuntimeDefinedParameterDictionary ( ) ;
38
38
var pResourceGroupName = new RuntimeDefinedParameter ( ) ;
39
39
pResourceGroupName . Name = "ResourceGroupName" ;
40
- pResourceGroupName . ParameterType = typeof ( System . String ) ;
40
+ pResourceGroupName . ParameterType = typeof ( string ) ;
41
41
pResourceGroupName . Attributes . Add ( new ParameterAttribute
42
42
{
43
43
ParameterSetName = "InvokeByDynamicParameters" ,
@@ -49,7 +49,7 @@ protected object CreateVirtualMachineScaleSetDeallocateInstancesDynamicParameter
49
49
50
50
var pVMScaleSetName = new RuntimeDefinedParameter ( ) ;
51
51
pVMScaleSetName . Name = "VMScaleSetName" ;
52
- pVMScaleSetName . ParameterType = typeof ( System . String ) ;
52
+ pVMScaleSetName . ParameterType = typeof ( string ) ;
53
53
pVMScaleSetName . Attributes . Add ( new ParameterAttribute
54
54
{
55
55
ParameterSetName = "InvokeByDynamicParameters" ,
@@ -61,7 +61,7 @@ protected object CreateVirtualMachineScaleSetDeallocateInstancesDynamicParameter
61
61
62
62
var pVMInstanceIDs = new RuntimeDefinedParameter ( ) ;
63
63
pVMInstanceIDs . Name = "VMInstanceIDs" ;
64
- pVMInstanceIDs . ParameterType = typeof ( Microsoft . Azure . Management . Compute . Models . VirtualMachineScaleSetVMInstanceIDs ) ;
64
+ pVMInstanceIDs . ParameterType = typeof ( string [ ] ) ;
65
65
pVMInstanceIDs . Attributes . Add ( new ParameterAttribute
66
66
{
67
67
ParameterSetName = "InvokeByDynamicParameters" ,
@@ -90,7 +90,9 @@ protected void ExecuteVirtualMachineScaleSetDeallocateInstancesMethod(object[] i
90
90
{
91
91
string resourceGroupName = ( string ) ParseParameter ( invokeMethodInputParameters [ 0 ] ) ;
92
92
string vmScaleSetName = ( string ) ParseParameter ( invokeMethodInputParameters [ 1 ] ) ;
93
- VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = ( VirtualMachineScaleSetVMInstanceIDs ) ParseParameter ( invokeMethodInputParameters [ 2 ] ) ;
93
+ var inputArray2 = Array . ConvertAll ( ( object [ ] ) ParseParameter ( invokeMethodInputParameters [ 2 ] ) , e => e . ToString ( ) ) ;
94
+ VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs ( ) ;
95
+ vmInstanceIDs . InstanceIDs = inputArray2 . ToList ( ) ;
94
96
95
97
var result = VirtualMachineScaleSetClient . DeallocateInstances ( resourceGroupName , vmScaleSetName , vmInstanceIDs ) ;
96
98
WriteObject ( result ) ;
@@ -103,16 +105,18 @@ protected PSArgument[] CreateVirtualMachineScaleSetDeallocateInstancesParameters
103
105
{
104
106
string resourceGroupName = string . Empty ;
105
107
string vmScaleSetName = string . Empty ;
106
- VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceIDs ( ) ;
108
+ var vmInstanceIDs = new string [ ] { } ;
107
109
108
- return ConvertFromObjectsToArguments ( new string [ ] { "ResourceGroupName" , "VMScaleSetName" , "VMInstanceIDs" } , new object [ ] { resourceGroupName , vmScaleSetName , vmInstanceIDs } ) ;
110
+ return ConvertFromObjectsToArguments (
111
+ new string [ ] { "ResourceGroupName" , "VMScaleSetName" , "VMInstanceIDs" } ,
112
+ new object [ ] { resourceGroupName , vmScaleSetName , vmInstanceIDs } ) ;
109
113
}
110
114
}
111
115
112
- [ Cmdlet ( "Stop" , "AzureVMSSInstancesWithDeallocation " ) ]
113
- public partial class StopAzureVMSSInstancesWithDeallocation : InvokeAzureComputeMethodCmdlet
116
+ [ Cmdlet ( "Stop" , "AzureVmssInstancesWithDeallocation" , DefaultParameterSetName = "InvokeByDynamicParameters ") ]
117
+ public partial class StopAzureVmssInstancesWithDeallocation : InvokeAzureComputeMethodCmdlet
114
118
{
115
- public StopAzureVMSSInstancesWithDeallocation ( )
119
+ public StopAzureVmssInstancesWithDeallocation ( )
116
120
{
117
121
this . MethodName = "VirtualMachineScaleSetDeallocateInstances" ;
118
122
}
@@ -129,7 +133,7 @@ public override object GetDynamicParameters()
129
133
dynamicParameters = new RuntimeDefinedParameterDictionary ( ) ;
130
134
var pResourceGroupName = new RuntimeDefinedParameter ( ) ;
131
135
pResourceGroupName . Name = "ResourceGroupName" ;
132
- pResourceGroupName . ParameterType = typeof ( System . String ) ;
136
+ pResourceGroupName . ParameterType = typeof ( string ) ;
133
137
pResourceGroupName . Attributes . Add ( new ParameterAttribute
134
138
{
135
139
ParameterSetName = "InvokeByDynamicParameters" ,
@@ -141,7 +145,7 @@ public override object GetDynamicParameters()
141
145
142
146
var pVMScaleSetName = new RuntimeDefinedParameter ( ) ;
143
147
pVMScaleSetName . Name = "VMScaleSetName" ;
144
- pVMScaleSetName . ParameterType = typeof ( System . String ) ;
148
+ pVMScaleSetName . ParameterType = typeof ( string ) ;
145
149
pVMScaleSetName . Attributes . Add ( new ParameterAttribute
146
150
{
147
151
ParameterSetName = "InvokeByDynamicParameters" ,
@@ -153,7 +157,7 @@ public override object GetDynamicParameters()
153
157
154
158
var pVMInstanceIDs = new RuntimeDefinedParameter ( ) ;
155
159
pVMInstanceIDs . Name = "VMInstanceIDs" ;
156
- pVMInstanceIDs . ParameterType = typeof ( Microsoft . Azure . Management . Compute . Models . VirtualMachineScaleSetVMInstanceIDs ) ;
160
+ pVMInstanceIDs . ParameterType = typeof ( string [ ] ) ;
157
161
pVMInstanceIDs . Attributes . Add ( new ParameterAttribute
158
162
{
159
163
ParameterSetName = "InvokeByDynamicParameters" ,
0 commit comments