Nanite.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<#
.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