Modules/businessdev.ALbuild.Feeds/businessdev.ALbuild.Feeds.psm1
|
#Requires -Version 5.1 Set-StrictMode -Version Latest # Root loader for businessdev.ALbuild.Feeds. # Dot-sources Classes -> Private -> Public and exports only the public functions. $ErrorActionPreference = 'Stop' $script:ModuleRoot = $PSScriptRoot # Module-scoped registry of feed providers, keyed by name (initialised for strict-mode safety). $script:BcFeedRegistry = [ordered]@{} foreach ($folder in 'Classes', 'Private', 'Public') { $path = Join-Path -Path $PSScriptRoot -ChildPath $folder if (-not (Test-Path -LiteralPath $path)) { continue } $files = Get-ChildItem -LiteralPath $path -Filter '*.ps1' -File -Recurse | Where-Object { $_.Name -notlike '*.Tests.ps1' } | Sort-Object FullName foreach ($file in $files) { try { . $file.FullName } catch { throw "businessdev.ALbuild.Feeds: failed to load '$($file.FullName)': $($_.Exception.Message)" } } } $publicFunctions = @() $publicPath = Join-Path -Path $PSScriptRoot -ChildPath 'Public' if (Test-Path -LiteralPath $publicPath) { $publicFunctions = @(Get-ChildItem -LiteralPath $publicPath -Filter '*.ps1' -File -Recurse | Where-Object { $_.Name -notlike '*.Tests.ps1' } | ForEach-Object { [System.IO.Path]::GetFileNameWithoutExtension($_.Name) }) } Export-ModuleMember -Function $publicFunctions |