2024-06-11 18:27:55 +00:00
|
|
|
$functionFolders = @('Public', 'Private', 'Classes')
|
|
|
|
|
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($folder -eq 'Public'){
|
|
|
|
|
Write-Verbose -Message " Importing $($function.BaseName)"
|
|
|
|
|
}
|
|
|
|
|
Write-Verbose -Message " Importing $($function.BaseName)"
|
|
|
|
|
. $($function.FullName)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\Public" -Filter '*.ps1').BaseName
|
|
|
|
|
Export-ModuleMember -Function $publicFunctions
|
2024-06-13 00:28:26 +00:00
|
|
|
|
|
|
|
|
# Optional modules to import for certain functions
|
|
|
|
|
Import-Module ConfigurationManager # -Wake
|