Description
When trying to enable Azure Disk Encryption, the the Virtual machine reports its' region without a space, whilst the keyVault does resulting in the following error:
To enable AzureDiskEncryption, VM and KeyVault must belong to same subscription and same region. vm Location: australiaeast , keyVault Location: australia east
At line:235 char:182
+ ... ion.ToLower()) , keyVault Location: $($keyVault.Location.ToLower())";
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
This appears to be an issue with this line which should also strip any spaces from the comparison.