-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXmlEx.psm1
27 lines (26 loc) · 1.02 KB
/
XmlEx.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
## Import localisation strings
if (Test-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath $PSUICulture))
{
$importLocalizedDataParams = @{
FileName = 'XmlEx.Resources.psd1';
BaseDirectory = Join-Path -Path $PSScriptRoot -ChildPath $PSUICulture;
}
}
else
{
# fallback to en-US
$importLocalizedDataParams = @{
FileName = 'XmlEx.Resources.psd1';
UICulture = 'en-US';
BaseDirectory = Join-Path -Path $PSScriptRoot -ChildPath 'en-US';
}
}
Import-LocalizedData -BindingVariable 'localized' @importLocalizedDataParams;
## Import the \Lib files. This permits loading of the module's functions for unit testing, without having to unload/load the module.
$moduleRoot = Split-Path -Path $MyInvocation.MyCommand.Path -Parent;
$moduleSrcPath = Join-Path -Path $moduleRoot -ChildPath 'Src';
Get-ChildItem -Path $moduleSrcPath -Include '*.ps1' -Recurse |
ForEach-Object {
Write-Verbose -Message ('Importing library\source file ''{0}''.' -f $_.FullName);
. $_.FullName;
}