-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPsOracle.psm1
34 lines (25 loc) · 1.78 KB
/
PsOracle.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
28
29
30
31
32
33
34
Write-Debug "Importing module PsOracle..."
##
# load settings
#
# populate the $Queries variable
Import-LocalizedData -FileName 'queries.psd1' -BindingVariable Queries
##
# load (dot-source) *.PS1 files, excluding unit-test scripts (*.Tests.*), and disabled scripts (__*)
#
@("$PSScriptRoot\Public\*.ps1","$PSScriptRoot\Private\*.ps1") | Get-ChildItem |
Where-Object { $_.Name -like '*.ps1' -and $_.Name -notlike '__*' -and $_.Name -notlike '*.Tests*' } |
% {
# dot-source script
Write-Debug "Loading $($_.BaseName)"
. $_
# export functions in the `Public` folder
if ( (Split-Path( $_.Directory) -Leaf) -Eq 'Public' ) {
Write-Debug "Exporting $($_.BaseName)"
Export-ModuleMember $_.BaseName
}
}
##
# manually export aliases specified in PS1 files
#
Export-ModuleMember -Alias oracle