Use $env:CORE_ROOT if set, otherwise AppContext.BaseDirectory
Otherwise the Json.NET DLL cannot be found when Pester tests are run over PSRP.
This commit is contained in:
parent
1d53e655f4
commit
5845a56d89
@ -8,7 +8,12 @@ $here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
Describe "Json.NET LINQ Parsing" {
|
||||
# load third party Json.NET library
|
||||
$base = [System.AppContext]::BaseDirectory
|
||||
if ([string]::IsNullOrEmpty($env:CORE_ROOT)) {
|
||||
$base = [System.AppContext]::BaseDirectory
|
||||
} else {
|
||||
$base = $env:CORE_ROOT
|
||||
}
|
||||
|
||||
$path = Join-Path $base Newtonsoft.Json.dll
|
||||
[Microsoft.PowerShell.CoreCLR.AssemblyExtensions]::LoadFrom($path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user