Data/MetaModule/template.psm1

# $functionFolders = @('Public', 'Internal', 'Classes') # not ready for classes yet
$functionFolders = @('Public', 'Internal')
ForEach ($folder in $functionFolders) {

  $folderPath = Join-Path -Path $PSScriptRoot -ChildPath $folder
  
  If (Test-Path -Path $folderPath) {

    Write-Verbose -Message "Importing from $folder"
    $functions = Get-ChildItem -Path $folderPath -Filter "*.ps1" 
    ForEach ($function in $functions) {
      
      if ($function.BaseName -match "tests") {
        continue
      }
      
      Write-Verbose -Message " Importing $($function.BaseName)"
      . $($function.FullName)
      
    }
  }    
}

# $aliasExports = @(
# @{ name = "psminit"; func = "Initialize-Psm" },
# @{ name = "psmf"; func = "Add-PsmFunction" },
# @{ name = "psmif"; func = "Add-PsmInternalFunction" },
# @{ name = "psmd"; func = "Add-PsmData" },
# @{ name = "ipsm"; func = "Add-PsmDependency" },
# @{ name = "psminstall"; func = "Install-PsmDependencies" },
# @{ name = "wpsm"; func = "Write-PsmManifest" }
# )

# $aliasExports | Foreach-Object {
# if (Test-Path alias:$_.name) {
# New-Alias -Name $_.name -Value $_.func
# }
# }

Write-Verbose "Exporting functions & aliases"
$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\Public").BaseName
Export-ModuleMember -Function $publicFunctions #-Alias $aliasExports.name