Load-Logging.psm1
$Api = @( Get-ChildItem -Path "$PSScriptRoot\Api\*.ps1" -Recurse -ErrorAction SilentlyContinue ) $Classes = @( Get-ChildItem -Path "$PSScriptRoot\Classes\*.ps1" -Recurse -ErrorAction SilentlyContinue ) $Public = @( Get-ChildItem -Path "$PSScriptRoot\Public\*.ps1" -Recurse -ErrorAction SilentlyContinue ) $Private = @( Get-ChildItem -Path "$PSScriptRoot\Private\*.ps1" -Recurse -ErrorAction SilentlyContinue ) foreach ($import in @($Api + $Classes + $Public + $Private)) { try { if($null -eq $import) { continue } if( [string]::IsNullOrEmpty($import) ) { continue } Write-Verbose ". $import" #-Verbose . $import.FullName } catch { Write-Warning "Failed to import file '$import'" throw } } |