-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathezb_poshjson.psm1
33 lines (26 loc) · 934 Bytes
/
ezb_poshjson.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
if(!$PSScriptRoot) {
$PSScriptRoot = $MyInovocation.PSScriptRoot
}
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
Foreach($import in @($Public + $Private))
{
Try
{
Write-Verbose "loading:$($import.fullname)"
. $import.fullname
}
Catch
{
Write-Error -Message "Failed to import function $($import.fullname): $_"
}
}
Export-ModuleMember -Function $Public.Basename
if ([Type]::GetType("Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver") -eq $Null) {
if ($PSVersionTable.PSEdition -eq "Core") {
[System.Reflection.Assembly]::LoadFile("${PSScriptRoot}\lib\netstandard1.3\Newtonsoft.Json.dll")
}
else {
[System.Reflection.Assembly]::LoadFile("${PSScriptRoot}\lib\net45\Newtonsoft.Json.dll")
}
}