Skip to content

Commit 0d1520c

Browse files
authored
Merge pull request #31 from shashaa35/master
Handling case when extensions list is empty but not null
2 parents ea16f3b + 5bd0990 commit 0d1520c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CopyKeys/CopyKeys.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ function Get-VirtualMachines
596596

597597
foreach ($Item in $VmList)
598598
{
599-
if (($null -ne $Item.Extensions) -and
599+
if (($null -ne $Item.Extensions -and $Item.Extensions.Count -gt 0) -and
600600
($Item.Extensions.Id | ForEach-Object { `
601601
$_.split('/')[-1].tolower().contains( `
602602
[ConstantStrings]::adeExtensionPrefix)}) -contains $true)
@@ -2103,4 +2103,4 @@ finally
21032103
$MyInvocation,
21042104
"CopyKeys completed - $EndTime.",
21052105
[LogType]::INFO)
2106-
}
2106+
}

CopyKeys/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ This script copies the disk encryption keys and key encryption keys for Azure Di
1515
|02/23 | - Fixed GUI issues in case of varying resolution.</br> - Fixed login bug in case of expired context. |
1616
|02/28 | - Removing hardcoded vault endpoint and replacing it with one provided by KeyVault RP. |
1717
|04/09 | - Providing MoveCollection MSI with appropriate target key vault access in case the script is used for Azure Resource Mover. |
18+
|30/10/2023 | - Handling case when extensions list is empty but not null

0 commit comments

Comments
 (0)