ems.PowerShell.Utility.psm1
Write-Verbose "Get files with private functions ..." # TODO Comment in when files are present in 'Private' folder # $privateFunctionsPath = Join-Path -Path $PSScriptRoot -ChildPath "Private/*.ps1" # TODO Comment in when files are present in 'Private' folder # $private = @(Get-ChildItem -Path $privateFunctionsPath -Recurse -ErrorAction Stop) Write-Verbose "Get all files with public functions ..." $publicFunctionsPath = Join-Path -Path $PSScriptRoot -ChildPath "Public/*.ps1" $public = @(Get-ChildItem -Path $publicFunctionsPath -Recurse -ErrorAction Stop) Write-Verbose "Dot source private and public files ..." # TODO Replace the following line with this comment when files are present in 'Private' folder # foreach ($file in @($public + $private)) { foreach ($file in @($public)) { try { Write-Verbose " $file" . $file.FullName -ErrorAction Stop } catch { throw "Unable to dot source: [$($file.FullName)]" } } Write-Verbose "Export public functions ..." Export-ModuleMember -Function $public.BaseName |