-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.psm1
24 lines (21 loc) · 826 Bytes
/
template.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
# Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
$Classes = @( Get-ChildItem -Path $PSScriptRoot\Classes\*.ps1 -ErrorAction SilentlyContinue )
# Dot source the files
Foreach($import in @($Public + $Private + $Classes))
{
Try
{
. $import.fullname
}
Catch
{
Write-Error -Message "Failed to import function $($import.fullname): $_"
}
}
# Update this section as needed.
# - Read in or create an initial config file and variable
# - Set variables visible to the module and its functions only
# This only exports the public functions and nothing else.
Export-ModuleMember -Function $Public.Basename