diff --git a/AppHandling/PsTestFunctions.ps1 b/AppHandling/PsTestFunctions.ps1 index 5aba59f44..8d82a9f78 100644 --- a/AppHandling/PsTestFunctions.ps1 +++ b/AppHandling/PsTestFunctions.ps1 @@ -6,9 +6,14 @@ [string] $clientContextScriptPath = $null ) +$antiSSRFdll = Join-Path ([System.IO.Path]::GetDirectoryName($clientDllPath)) 'Microsoft.Internal.AntiSSRF.dll' + # Load DLL's -Add-type -Path $clientDllPath Add-type -Path $newtonSoftDllPath +if (Test-Path $antiSSRFdll) { + Add-Type -Path $antiSSRFdll +} +Add-type -Path $clientDllPath if (!($clientContextScriptPath)) { $clientContextScriptPath = Join-Path $PSScriptRoot "ClientContext.ps1" diff --git a/AppHandling/Run-ConnectionTestToNavContainer.ps1 b/AppHandling/Run-ConnectionTestToNavContainer.ps1 index 8fcc2c84c..bf36906e7 100644 --- a/AppHandling/Run-ConnectionTestToNavContainer.ps1 +++ b/AppHandling/Run-ConnectionTestToNavContainer.ps1 @@ -151,6 +151,10 @@ try { $clientDllPath = "C:\Test Assemblies\Microsoft.Dynamics.Framework.UI.Client.dll" if (!(Test-Path $myClientDllPath)) { Copy-Item -Path $clientDllPath -Destination $myClientDllPath + $antiSSRFdll = Join-Path ([System.IO.Path]::GetDirectoryName($clientDllPath)) 'Microsoft.Internal.AntiSSRF.dll' + if (Test-Path $antiSSRFdll) { + Copy-Item -Path $antiSSRFdll -Destination ([System.IO.Path]::GetDirectoryName($myClientDllPath)) + } } } -argumentList $newtonSoftDllPath, $clientDllPath diff --git a/AppHandling/Run-TestsInNavContainer.ps1 b/AppHandling/Run-TestsInNavContainer.ps1 index b56a28093..4938c7e0e 100644 --- a/AppHandling/Run-TestsInNavContainer.ps1 +++ b/AppHandling/Run-TestsInNavContainer.ps1 @@ -328,6 +328,10 @@ try { $clientDllPath = "C:\Test Assemblies\Microsoft.Dynamics.Framework.UI.Client.dll" if (!(Test-Path $myClientDllPath)) { Copy-Item -Path $clientDllPath -Destination $myClientDllPath + $antiSSRFdll = Join-Path ([System.IO.Path]::GetDirectoryName($clientDllPath)) 'Microsoft.Internal.AntiSSRF.dll' + if (Test-Path $antiSSRFdll) { + Copy-Item -Path $antiSSRFdll -Destination ([System.IO.Path]::GetDirectoryName($myClientDllPath)) + } } } -argumentList $newtonSoftDllPath, $clientDllPath } diff --git a/HelperFunctions.ps1 b/HelperFunctions.ps1 index 110a9ad3b..2c963e702 100644 --- a/HelperFunctions.ps1 +++ b/HelperFunctions.ps1 @@ -912,6 +912,10 @@ Function CreatePsTestToolFolder { if (!(Test-Path $myClientDllPath)) { $clientDllPath = "C:\Test Assemblies\Microsoft.Dynamics.Framework.UI.Client.dll" Copy-Item -Path $clientDllPath -Destination $myClientDllPath + $antiSSRFdll = Join-Path ([System.IO.Path]::GetDirectoryName($clientDllPath)) 'Microsoft.Internal.AntiSSRF.dll' + if (Test-Path $antiSSRFdll) { + Copy-Item -Path $antiSSRFdll -Destination ([System.IO.Path]::GetDirectoryName($myClientDllPath)) + } } } -argumentList (Get-BcContainerPath -containerName $containerName -Path $newtonSoftDllPath), (Get-BcContainerPath -containerName $containerName -Path $clientDllPath) }