forked from Marco-online/MSCatalogLTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMSCatalogLTS.psm1
More file actions
36 lines (32 loc) · 1.03 KB
/
MSCatalogLTS.psm1
File metadata and controls
36 lines (32 loc) · 1.03 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
30
31
32
33
34
35
36
try {
if (!([System.Management.Automation.PSTypeName]'HtmlAgilityPack.HtmlDocument').Type) {
if ($PSVersionTable.PSEdition -eq "Desktop") {
Add-Type -Path "$PSScriptRoot\Types\Net45\HtmlAgilityPack.dll"
} else {
Add-Type -Path "$PSScriptRoot\Types\netstandard2.0\HtmlAgilityPack.dll"
}
}
} catch {
Write-Error -Message "Failed to load HtmlAgilityPack: $_"
throw
}
$Classes = @(Get-ChildItem -Path $PSScriptRoot\Classes\*.ps1)
$Private = @(Get-ChildItem -Path $PSScriptRoot\Private\*.ps1)
$Public = @(Get-ChildItem -Path $PSScriptRoot\Public\*.ps1)
foreach ($ClassFile in $Classes) {
try {
. $ClassFile.FullName
} catch {
Write-Error -Message "Failed to import class $($ClassFile.FullName): $_"
throw
}
}
foreach ($Module in ($Private + $Public)) {
try {
. $Module.FullName
} catch {
Write-Error -Message "Failed to import function $($Module.FullName): $_"
throw
}
}
Export-ModuleMember -Function $Public.BaseName