From c921a7e8bca530b47ae39d0e748de423ce77f869 Mon Sep 17 00:00:00 2001 From: Maoliang Huang Date: Wed, 25 May 2022 09:37:28 -0700 Subject: [PATCH] Fix the issue in unit tests. - In the module we create a minimum runspace for PowerShell, and use it to parse the command line. The mini runspace contains the built-in core modules for PowerShell. We don't need them when we package and publish our module because the runtime will have them. That'll reduce the module size. So in the module project we exclude `contentfiles` when we referece Microsoft.PowerShell.SDK. - The issue in the unit tests is that it doesn't find the built-in core module when we create the runspace. So we have a reference to Microsoft.PowerShell.SDK in the test project to include `contentfiles` to provide the built-in core modules. The unit tests can run successfully. --- .../Az.Tools.Predictor.Test/Az.Tools.Predictor.Test.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/Az.Tools.Predictor/Az.Tools.Predictor.Test/Az.Tools.Predictor.Test.csproj b/tools/Az.Tools.Predictor/Az.Tools.Predictor.Test/Az.Tools.Predictor.Test.csproj index 304d4b7a6a23..f4f48f09c05f 100644 --- a/tools/Az.Tools.Predictor/Az.Tools.Predictor.Test/Az.Tools.Predictor.Test.csproj +++ b/tools/Az.Tools.Predictor/Az.Tools.Predictor.Test/Az.Tools.Predictor.Test.csproj @@ -24,6 +24,11 @@ all + +