Nanite.psm1
<#
.SYNOPSIS Loads all functions. .DESCRIPTION This is the module's official entry point. It enumerates all ..\Public\ and ..\Private\ functions and loads them using dot-sourcing. Public functions are then exported as module members so that users can call them directly after importing the module. Any function's filename that begins with an underscore (_) will be loaded first. This is useful in prioritizing the loading of functions that may get called by other functions as they load. .NOTES Initial framework author: Cale Vernon (CAVERNON) #> $privateFunctions = Get-ChildItem -Path "$PSScriptRoot\Private" -Recurse -Filter '*.ps1' | Sort-Object Name ForEach ($file in $privateFunctions) { . $file.FullName } $publicFunctions = Get-ChildItem -Path "$PSScriptRoot\Public" -Recurse -Filter '*.ps1' | Sort-Object Name ForEach ($file in $publicFunctions) { . $file.FullName } Export-ModuleMember -Function $publicFunctions.BaseName # Call the initialization routine. Initialize-Nanite |