@@ -257,17 +257,27 @@ public override void ExecuteCmdlet()
257
257
this . Name ,
258
258
parameters ) . GetAwaiter ( ) . GetResult ( ) ;
259
259
260
- if ( string . IsNullOrWhiteSpace ( VolumeType ) ||
261
- VolumeType . Equals ( AzureDiskEncryptionExtensionContext . VolumeTypeAll , StringComparison . InvariantCultureIgnoreCase ) ||
262
- VolumeType . Equals ( AzureDiskEncryptionExtensionContext . VolumeTypeOS , StringComparison . InvariantCultureIgnoreCase ) )
260
+ // +---------+---------------+----------------------------+
261
+ // | OSType | VolumeType | UpdateVmEncryptionSettings |
262
+ // +---------+---------------+----------------------------+
263
+ // | Windows | OS | Yes |
264
+ // | Windows | Data | No |
265
+ // | Windows | Not Specified | Yes |
266
+ // | Linux | OS | N/A |
267
+ // | Linux | Data | Yes |
268
+ // | Linux | Not Specified | N/A |
269
+ // +---------+---------------+----------------------------+
270
+
271
+ if ( OperatingSystemTypes . Windows . Equals ( currentOSType ) &&
272
+ VolumeType . Equals ( AzureDiskEncryptionExtensionContext . VolumeTypeData , StringComparison . InvariantCultureIgnoreCase ) )
263
273
{
264
- var opVm = UpdateVmEncryptionSettings ( ) ;
265
- var result = Mapper . Map < PSAzureOperationResponse > ( opVm ) ;
274
+ var result = Mapper . Map < PSAzureOperationResponse > ( opExt ) ;
266
275
WriteObject ( result ) ;
267
276
}
268
277
else
269
278
{
270
- var result = Mapper . Map < PSAzureOperationResponse > ( opExt ) ;
279
+ var opVm = UpdateVmEncryptionSettings ( ) ;
280
+ var result = Mapper . Map < PSAzureOperationResponse > ( opVm ) ;
271
281
WriteObject ( result ) ;
272
282
}
273
283
}
0 commit comments