From da50342c803c291b326e5857605d56d85f752a92 Mon Sep 17 00:00:00 2001 From: rulasg Date: Mon, 9 Oct 2023 08:54:33 +0200 Subject: [PATCH] bug-confusing-error-message-on-multiple-psd1 --- private/Manifest.Helper.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/private/Manifest.Helper.ps1 b/private/Manifest.Helper.ps1 index 304d910..c9ed557 100644 --- a/private/Manifest.Helper.ps1 +++ b/private/Manifest.Helper.ps1 @@ -6,9 +6,13 @@ function Get-ModuleManifest($Path){ $psdpath = Get-ChildItem -Path $localPath -Filter "*.psd1" -ErrorAction SilentlyContinue - if($psdpath.count -ne 1){ + if($psdpath.count -eq 0){ throw "No psd1 file found in path $localPath" } + + if($psdpath.count -ne 1){ + throw "More than one manifest (psd1) found on module path" + } $manifest = Import-PowerShellDataFile -Path $psdpath.FullName