@@ -137,8 +137,14 @@ public override void ExecuteCmdlet()
137
137
Name = ( string ) t [ "Name" ] ,
138
138
RegionalReplicaCount = ( int ? ) t [ "ReplicaCount" ] ,
139
139
StorageAccountType = ( string ) t [ "StorageAccountType" ] ,
140
- Encryption = ( t [ "Encryption" ] == null ) ? ( EncryptionImages ) t [ "Encryption" ] : null
141
140
} ;
141
+ if ( t [ "Encryption" ] != null )
142
+ {
143
+ var osDiskEncryptionSetId = ( string ) ( ( Hashtable ) ( ( Hashtable ) t [ "Encryption" ] ) [ "osDiskImage" ] ) [ "DiskEncryptionSetId" ] ;
144
+ var dataDiskEncryptionSetIds = new List < DataDiskImageEncryption > ( ) ;
145
+ var osDiskImage = new OSDiskImageEncryption ( osDiskEncryptionSetId ) ;
146
+ target . Encryption = new EncryptionImages ( osDiskImage , dataDiskImage ) ;
147
+ }
142
148
143
149
galleryImageVersion . PublishingProfile . TargetRegions . Add ( target ) ;
144
150
}
@@ -332,8 +338,13 @@ public override void ExecuteCmdlet()
332
338
Name = ( string ) t [ "Name" ] ,
333
339
RegionalReplicaCount = ( int ? ) t [ "ReplicaCount" ] ,
334
340
StorageAccountType = ( string ) t [ "StorageAccountType" ] ,
335
- Encryption = ( t [ "Encryption" ] == null ) ? ( EncryptionImages ) t [ "Encryption" ] : null
336
341
} ;
342
+ if ( t [ "Encryption" ] != null )
343
+ {
344
+ var EncryptionSetId = ( string ) ( ( Hashtable ) ( ( Hashtable ) t [ "Encryption" ] ) [ "osDiskImage" ] ) [ "DiskEncryptionSetId" ] ;
345
+ var osDiskImage = new OSDiskImageEncryption ( EncryptionSetId ) ;
346
+ target . Encryption = new EncryptionImages ( osDiskImage ) ;
347
+ }
337
348
338
349
galleryImageVersion . PublishingProfile . TargetRegions . Add ( target ) ;
339
350
}
0 commit comments