From 7ae117dcc84fbb6dc3ee41c92d0abfee37e3442d Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 12 Feb 2024 14:18:36 -0800 Subject: [PATCH 1/3] set psmodulepath to fix the pwsh7.4 issue --- builder/actions/setup_cross_ci_helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/actions/setup_cross_ci_helpers.py b/builder/actions/setup_cross_ci_helpers.py index 968426028..4888f1844 100644 --- a/builder/actions/setup_cross_ci_helpers.py +++ b/builder/actions/setup_cross_ci_helpers.py @@ -23,6 +23,7 @@ def create_windows_cert_store(env, certificate_env, location_env): # Import the PFX into the Windows Certificate Store # (Passing '$mypwd' is required even though it is empty and our certificate has no password. It fails CI otherwise) import_pfx_arguments = [ + "$env:PSModulePath = '';", "Import-PfxCertificate", "-FilePath", pfx_cert_path, "-CertStoreLocation", windows_certificate_folder] From a46e61b9aa47198afcd777cd806cfbdb04f670f4 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 12 Feb 2024 14:20:53 -0800 Subject: [PATCH 2/3] enable win cert store test --- builder/actions/setup_cross_ci_crt_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/actions/setup_cross_ci_crt_environment.py b/builder/actions/setup_cross_ci_crt_environment.py index cb4c9c2bd..d8dc7cef2 100644 --- a/builder/actions/setup_cross_ci_crt_environment.py +++ b/builder/actions/setup_cross_ci_crt_environment.py @@ -16,7 +16,7 @@ # TODO: The variable is used to disable the windows certificate store test to unblock a CI failure. # The variable should be set to TRUE after the CI is fixed. -ENABLE_WINDOWS_CERT_STORE_TEST = False +ENABLE_WINDOWS_CERT_STORE_TEST = True class SetupCrossCICrtEnvironment(Action): From b064aa9662e054697652073c582501352430968e Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 12 Feb 2024 15:06:10 -0800 Subject: [PATCH 3/3] update comments --- builder/actions/setup_cross_ci_crt_environment.py | 3 +-- builder/actions/setup_cross_ci_helpers.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builder/actions/setup_cross_ci_crt_environment.py b/builder/actions/setup_cross_ci_crt_environment.py index d8dc7cef2..259e70974 100644 --- a/builder/actions/setup_cross_ci_crt_environment.py +++ b/builder/actions/setup_cross_ci_crt_environment.py @@ -14,8 +14,7 @@ environment variables, secrets, files, etc. that is used to build up the testing environment. """ -# TODO: The variable is used to disable the windows certificate store test to unblock a CI failure. -# The variable should be set to TRUE after the CI is fixed. +# Enable windows certificate store test ENABLE_WINDOWS_CERT_STORE_TEST = True diff --git a/builder/actions/setup_cross_ci_helpers.py b/builder/actions/setup_cross_ci_helpers.py index 4888f1844..1c0230684 100644 --- a/builder/actions/setup_cross_ci_helpers.py +++ b/builder/actions/setup_cross_ci_helpers.py @@ -23,6 +23,9 @@ def create_windows_cert_store(env, certificate_env, location_env): # Import the PFX into the Windows Certificate Store # (Passing '$mypwd' is required even though it is empty and our certificate has no password. It fails CI otherwise) import_pfx_arguments = [ + # Powershell 7.3 introduced an issue where launching powershell from cmd would not set PSModulePath correctly. + # As a workaround, we set `PSModulePath` to empty so powershell would automatically reset the PSModulePath to default. + # More details: https://github.com/PowerShell/PowerShell/issues/18530 "$env:PSModulePath = '';", "Import-PfxCertificate", "-FilePath", pfx_cert_path,