@@ -140,6 +140,21 @@ private VirtualMachineExtension GetVmExtensionParameters(VirtualMachine vmParame
140
140
AutoUpgradeMinorVersion = ! DisableAutoUpgradeMinorVersion . IsPresent
141
141
} ;
142
142
}
143
+ if ( OperatingSystemTypes . Linux . Equals ( currentOSType ) )
144
+ {
145
+ this . Name = this . Name ?? AzureDiskEncryptionExtensionContext . LinuxExtensionDefaultName ;
146
+
147
+ vmExtensionParameters = new VirtualMachineExtension
148
+ {
149
+ Location = vmParameters . Location ,
150
+ Publisher = AzureDiskEncryptionExtensionContext . LinuxExtensionDefaultPublisher ,
151
+ VirtualMachineExtensionType = AzureDiskEncryptionExtensionContext . LinuxExtensionDefaultName ,
152
+ TypeHandlerVersion = ( this . TypeHandlerVersion ) ?? AzureDiskEncryptionExtensionContext . LinuxExtensionDefaultVersion ,
153
+ Settings = SettingString ,
154
+ ProtectedSettings = ProtectedSettingString ,
155
+ AutoUpgradeMinorVersion = ! DisableAutoUpgradeMinorVersion . IsPresent
156
+ } ;
157
+ }
143
158
144
159
return vmExtensionParameters ;
145
160
}
@@ -214,18 +229,6 @@ public override void ExecuteCmdlet()
214
229
}
215
230
216
231
currentOSType = virtualMachineResponse . StorageProfile . OsDisk . OsType ;
217
- if ( OperatingSystemTypes . Linux . Equals ( currentOSType ) )
218
- {
219
- ThrowTerminatingError (
220
- new ErrorRecord (
221
- new ArgumentException (
222
- string . Format (
223
- CultureInfo . CurrentUICulture ,
224
- "Disable-AzureDiskEncryption cmdlet is supported only for Windows virtual machines" ) ) ,
225
- "InvalidType" ,
226
- ErrorCategory . NotImplemented ,
227
- null ) ) ;
228
- }
229
232
230
233
if ( this . Force . IsPresent ||
231
234
this . ShouldContinue ( Properties . Resources . DisableAzureDiskEncryptionConfirmation , Properties . Resources . DisableAzureDiskEncryptionCaption ) )
0 commit comments