diff --git a/test/csharp/test_Runspace.cs b/test/csharp/test_Runspace.cs index 70335af0f7..398c924729 100644 --- a/test/csharp/test_Runspace.cs +++ b/test/csharp/test_Runspace.cs @@ -13,6 +13,12 @@ namespace PSTests private static int count = 3; private static string script = String.Format($"get-process | select-object -first {count}"); + // Initialize the Core PowerShell AssemblyLoadContext + public RunspaceTests() + { + PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(AppContext.BaseDirectory); + } + [Fact] public void TestRunspaceWithPipeline() {