diff --git a/.tests/Merge-DSCConfigurationData.Tests.ps1 b/.tests/Merge-DSCConfigurationData.Tests.ps1 index 3858e57..6ca2518 100644 --- a/.tests/Merge-DSCConfigurationData.Tests.ps1 +++ b/.tests/Merge-DSCConfigurationData.Tests.ps1 @@ -129,4 +129,30 @@ Describe "Merge-DSCConfigurationData" { ($Registry | Where-Object { $_.Key -eq "K1" }).ValueData | Should Be "Deployment-K1" ($Registry | Where-Object { $_.Key -eq "K2" }).Default | Should Be "Template-K2" } + + It "accepts arrays whose items do not have merge keys" { + $Template = @{ + Parameters = @{ + AuthenticationMethod = @{ + AllowedValues = @( + "NTLM", + "Kerberos" + ) + } + } + } + + $Deployment = @{ + Parameters = @{ + AuthenticationMethod = @{ + AllowedValues = @( + "NTLM", + "Kerberos" + ) + } + } + } + + { Merge-DSCConfigurationData -Template $Template -Deployment $Deployment } | Should Not Throw + } } diff --git a/Merge-DSCConfigurationData.psd1 b/Merge-DSCConfigurationData.psd1 index 88b0677..6868f20 100644 --- a/Merge-DSCConfigurationData.psd1 +++ b/Merge-DSCConfigurationData.psd1 @@ -1,6 +1,6 @@ -@{ +@{ RootModule = "Merge-DSCConfigurationData.psm1" - ModuleVersion = "1.1.0" + ModuleVersion = "1.1.1" GUID = "c1c7e70d-9049-4eaa-a3c9-44a424c35ef5" Author = "Torsten Brendgen" Copyright = "(c) Torsten Brendgen. All rights reserved." @@ -21,7 +21,7 @@ "DSC", "ConfigurationData" ) - ReleaseNotes = "Initial module layout." + ReleaseNotes = "Allows empty array merge-key collections so scalar arrays such as AllowedValues merge without parameter binding errors." } } } diff --git a/Private/Test-ConfigurationDataItemWildcard.ps1 b/Private/Test-ConfigurationDataItemWildcard.ps1 index 4676f49..2158053 100644 --- a/Private/Test-ConfigurationDataItemWildcard.ps1 +++ b/Private/Test-ConfigurationDataItemWildcard.ps1 @@ -4,6 +4,7 @@ function Test-ConfigurationDataItemWildcard { [AllowNull()] $Item, [Parameter(Mandatory=$true)] + [AllowEmptyCollection()] [String[]] $KeyNames )