DosInstallUtilities.psm1
$script:ModuleRoot = "$PSScriptRoot" $script:FunctionRoot = "$($script:ModuleRoot)\functions" $script:InternalFunctionRoot = "$($script:ModuleRoot)\internal" function Import-Function{ param( [string] $folderPath ) $functionFiles = Get-ChildItem -Path $folderPath -Filter *.ps1 Write-Verbose "Loading scripts in $folderPath" foreach($file in $functionFiles){ Write-Verbose "Sourcing $($file.FullName)" . $file.FullName } } # Have to dot source the function call, otherwise the function are only loaded in the function scope (and not visible in to the module) . Import-Function -folderPath $script:InternalFunctionRoot . Import-Function -folderPath $script:FunctionRoot |