forked from PowerShell/PowerShellGetv2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSModule.psm1
More file actions
29 lines (23 loc) · 1.11 KB
/
PSModule.psm1
File metadata and controls
29 lines (23 loc) · 1.11 KB
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
28
29
# Load localized data
Import-LocalizedData LocalizedData -filename PSGet.Resource.psd1
# Dot source the first part of this file from .\private\modulefile\PartOne.ps1
. "$PSScriptRoot\private\modulefile\PartOne.ps1"
# region Load of module functions after split from main .psm1 file issue Fix#37
$PublicFunctions = @( Get-ChildItem -Path $PSScriptRoot\public\*.ps1 -Recurse -ErrorAction SilentlyContinue )
$PrivateFunctions = @( Get-ChildItem -Path $PSScriptRoot\private\functions\*.ps1 -ErrorAction SilentlyContinue )
# Load the separate function files from the private and public folders.
$AllFunctions = $PublicFunctions + $PrivateFunctions
foreach($function in $AllFunctions) {
try {
. $function.Fullname
}
catch {
Write-Error -Message "Failed to import function $($function.fullname): $_"
}
}
# Export the public functions
Export-ModuleMember -Function $PublicFunctions.BaseName
#endregion
# now dot source the rest of this file from .\private\modulefile\PartTwo.ps1 (after the private and public
# functions have been dot sourced above.)
. "$PSScriptRoot\private\modulefile\PartTwo.ps1"