From 6b5007ed301edde8c86ab1c41edae74f3cb15269 Mon Sep 17 00:00:00 2001 From: Shashank Agarwal Date: Mon, 30 Oct 2023 16:09:46 +0530 Subject: [PATCH 1/2] Handling case when extensions list is empty but not null --- CopyKeys/CopyKeys.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CopyKeys/CopyKeys.ps1 b/CopyKeys/CopyKeys.ps1 index e5d1e5d..ac99789 100644 --- a/CopyKeys/CopyKeys.ps1 +++ b/CopyKeys/CopyKeys.ps1 @@ -596,7 +596,7 @@ function Get-VirtualMachines foreach ($Item in $VmList) { - if (($null -ne $Item.Extensions) -and + if (($null -ne $Item.Extensions -and $Item.Extensions.Count -gt 0) -and ($Item.Extensions.Id | ForEach-Object { ` $_.split('/')[-1].tolower().contains( ` [ConstantStrings]::adeExtensionPrefix)}) -contains $true) @@ -2103,4 +2103,4 @@ finally $MyInvocation, "CopyKeys completed - $EndTime.", [LogType]::INFO) -} \ No newline at end of file +} From 5bd09900c294cdb42e1c61213990c65f1ba9da40 Mon Sep 17 00:00:00 2001 From: Shashank Agarwal Date: Mon, 30 Oct 2023 16:10:45 +0530 Subject: [PATCH 2/2] Update README.md --- CopyKeys/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CopyKeys/README.md b/CopyKeys/README.md index 2b85fc8..e0c0d4a 100644 --- a/CopyKeys/README.md +++ b/CopyKeys/README.md @@ -15,3 +15,4 @@ This script copies the disk encryption keys and key encryption keys for Azure Di |02/23 | - Fixed GUI issues in case of varying resolution.
- Fixed login bug in case of expired context. | |02/28 | - Removing hardcoded vault endpoint and replacing it with one provided by KeyVault RP. | |04/09 | - Providing MoveCollection MSI with appropriate target key vault access in case the script is used for Azure Resource Mover. | +|30/10/2023 | - Handling case when extensions list is empty but not null