Kritical.PS.TCM.psm1
|
# Kritical.PS.TCM.psm1 — CANONICAL root loader (wave .1514, 2026-07-02). # # This is the canonical Kritical.PS.TCM module. Krit.TCM ships alongside as # a deprecation shim until 2027-01-01 per KRITICAL-BRAND-RENAME-PLAN.md. # # Loads: # - Private/ helpers first (recursive) # - Public/ functions next (recursive — picks up Public/<Category>/*.ps1 # wrappers emitted by New-KritTcmFromM365DscHelpers.ps1) # - Soft-loads Krit.OmniFramework foundation (renamed Kritical.OmniFramework # per rename plan Phase 2 — until then loads whichever is available) $ErrorActionPreference = 'Stop' # Soft-load OmniFramework foundation (canonical or legacy name). $omni = Get-Module -ListAvailable Kritical.OmniFramework | Sort-Object Version -Descending | Select-Object -First 1 if (-not $omni) { $omni = Get-Module -ListAvailable Krit.OmniFramework | Sort-Object Version -Descending | Select-Object -First 1 } if ($omni) { try { Import-Module $omni.Name -Force -ErrorAction Stop -Global } catch { Write-Verbose "[Kritical.PS.TCM] OmniFramework soft-load skipped: $($_.Exception.Message)" } } # Dot-source Private + Public (recurse to pick up per-category wrappers). $Private = @(Get-ChildItem -Path (Join-Path $PSScriptRoot 'Private') -Filter '*.ps1' -Recurse -ErrorAction SilentlyContinue) $Public = @(Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') -Filter '*.ps1' -Recurse -ErrorAction SilentlyContinue) foreach ($file in $Private + $Public) { try { . $file.FullName } catch { Write-Error "[Kritical.PS.TCM] Failed to dot-source $($file.FullName): $($_.Exception.Message)" } } Export-ModuleMember -Function $Public.BaseName |