Posh-YBKPIV.psm1

$script:ModuleRoot = $PSScriptRoot
$script:ConfigPath = Join-Path -Path $PSScriptRoot -ChildPath 'Config\Posh-YBKPIV.json'

# Logging severity order, used by Write-PWSHYBKPIVLog to compare a log entry's Level
# against the configured MinimumLevel. Debug also doubles as the EventLog entry
# type/EventId for Debug-level entries, since Windows Event Log has no Debug type.
$script:LogLevelSeverity    = @{ Debug = 0; Information = 1; Warning = 2; Error = 3 }
# "Warn once per session" flags so a misconfigured or unreachable logging destination
# doesn't spam Write-Warning on every single log call.
$script:LoggingConfigWarned = $false
$script:LoggingSinkFailed   = $false

Get-ChildItem -Path "$PSScriptRoot\Private" -Recurse -Filter '*.ps1' -ErrorAction Stop |
    ForEach-Object { . $_.FullName }

Get-ChildItem -Path "$PSScriptRoot\Public" -Filter '*.ps1' -ErrorAction Stop |
    ForEach-Object {
        . $_.FullName
        Export-ModuleMember -Function $_.BaseName
    }