diff --git a/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 b/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 index 54a3e46..89c5d12 100644 --- a/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1 @@ -23,6 +23,10 @@ Write-Verbose "[$manifestPropertyName] - Checking path for functions and filters" $publicFolderPath = Join-Path -Path $SourceFolderPath -ChildPath 'functions/public' + if (-not (Test-Path -Path $publicFolderPath -PathType Container)) { + Write-Verbose "[$manifestPropertyName] - [Folder not found] - [$publicFolderPath]" + return $functionsToExport + } Write-Verbose "[$manifestPropertyName] - [$publicFolderPath]" $functionsToExport = [Collections.Generic.List[string]]::new() $scriptFiles = Get-ChildItem -Path $publicFolderPath -Recurse -File -ErrorAction SilentlyContinue -Include '*.ps1' diff --git a/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 b/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 index ff9a7dd..b8cd523 100644 --- a/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 +++ b/scripts/helpers/Build/Get-PSModuleVariablesToExport.ps1 @@ -22,6 +22,10 @@ Write-Verbose "[$manifestPropertyName]" $variableFolderPath = Join-Path -Path $SourceFolderPath -ChildPath 'variables/public' + if (-not (Test-Path -Path $variableFolderPath -PathType Container)) { + Write-Verbose "[$manifestPropertyName] - [Folder not found] - [$variableFolderPath]" + return $variablesToExport + } $scriptFilePaths = Get-ChildItem -Path $variableFolderPath -Recurse -File -Filter *.ps1 | Select-Object -ExpandProperty FullName $variablesToExport = [Collections.Generic.List[string]]::new()