ZertoPS.psm1
# Get public function definition files and dot source them $Private = @(Get-ChildItem -Path "$PSScriptRoot\Private\*.ps1") $Public = @(Get-ChildItem -Path "$PSScriptRoot\Public\*\*.ps1") $Formats = @(Get-ChildItem -Path "$PSScriptRoot\Format\*.ps1xml") foreach ($Module in @($Private + $Public)) { try { . $Module.FullName } catch { Write-Error -Message "Failed to import function $($Module.FullName): $_" } } Export-ModuleMember -Function $Public.BaseName foreach ($Format in $Formats) { try { Update-FormatData -AppendPath $Format.FullName } catch { Write-Error -Message "Failed to update format data using $($Format.FullName): $_" } } |