-
Notifications
You must be signed in to change notification settings - Fork 0
/
makl.weather.psm1
30 lines (26 loc) · 937 Bytes
/
makl.weather.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
$public = Get-ChildItem -Path (Join-Path $PSScriptRoot "public") -Recurse -Filter *.ps1
$private = Get-ChildItem -Path (Join-Path $PSScriptRoot "private") -Recurse -Filter *.ps1
#Load public functions
foreach ($import in $public)
{
try {. $import.FullName}
catch {Write-Error ("Failed to import public function {0}" -f $import.BaseName)}
}
#Load private functions
foreach ($import in $private)
{
try {. $import.FullName}
catch {Write-Error ("Failed to import private function {0}" -f $import.BaseName)}
}
#Load WEATHER_SETTINGS
try
{
$Global:WEATHER_SETTINGS = ([xml](Get-Content (Join-Path $PSScriptRoot "settings.xml")))
$Global:WEATHER_SETTINGS.settings.data.cache = [string](Join-Path $PSScriptRoot $Global:WEATHER_SETTINGS.settings.data.cache)
}
catch
{
Write-Error "Could not load module settings"
}
#Export only public functions
Export-ModuleMember -Function $public.BaseName