Skip to content

Commit bf7a4e0

Browse files
author
Sudhakara Reddy Evuri
committed
Updating help files for AzureDiskEncryption cmdlets, updating test to add pre-encrypted VM
1 parent a4c06f9 commit bf7a4e0

File tree

2 files changed

+17007
-10994
lines changed

2 files changed

+17007
-10994
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,17 @@ function Test-AzureDiskEncryptionExtension
907907
#Remove AzureDiskEncryption extension
908908
Remove-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgname -VMName $vmName;
909909

910+
#Remove the VM
911+
Remove-AzureRmVm -ResourceGroupName $rgname -Name $vmName -Force;
912+
913+
#Create a brand new VM using the same OS vhd encrypted above
914+
$p.StorageProfile.ImageReference = $null;
915+
$p.OSProfile = $null;
916+
$p.StorageProfile.DataDisks = $null;
917+
$p = Set-AzureRmVMOSDisk -VM $p -Name $p.StorageProfile.OSDisk.Name -VhdUri $p.StorageProfile.OSDisk.VirtualHardDisk.Uri -Caching ReadWrite -CreateOption attach -DiskEncryptionKeyUrl $encryptionStatus.OsVolumeEncryptionSettings.DiskEncryptionKey.SecretUrl -DiskEncryptionKeyVaultId $encryptionStatus.OsVolumeEncryptionSettings.DiskEncryptionKey.SourceVault.ReferenceUri -Windows;
918+
919+
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;
920+
910921
}
911922
finally
912923
{

0 commit comments

Comments
 (0)