From bde37df65aedd9454564d4e5d3433d5b555b69ee Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Tue, 18 Aug 2026 22:44:58 +0200 Subject: [PATCH] =?UTF-8?q?Erweitere=20Tests=20f=C3=BCr=20Merge-DSCConfigu?= =?UTF-8?q?rationData,=20um=20leere=20Array-Merge-Schl=C3=BCssel=20zu=20ak?= =?UTF-8?q?zeptieren=20und=20Parameterbindung-Fehler=20zu=20vermeiden.=20A?= =?UTF-8?q?ktualisiere=20Modulversion=20auf=201.1.1=20und=20passe=20Releas?= =?UTF-8?q?e-Notizen=20an.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .tests/Merge-DSCConfigurationData.Tests.ps1 | 26 +++++++++++++++++++ Merge-DSCConfigurationData.psd1 | 6 ++--- .../Test-ConfigurationDataItemWildcard.ps1 | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) 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 )