Skip to content

Commit

Permalink
update run_sample_ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Feb 13, 2024
1 parent f66a969 commit 4881c46
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion utils/run_sample_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,18 @@ def make_windows_pfx_file(certificate_file_path, private_key_path, pfx_file_path

# 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.exe", "Import-PfxCertificate", "-FilePath", pfx_file_path, "-CertStoreLocation", "Cert:\\" + pfx_certificate_store_location, "-Password", "$mypwd"]
import_pfx_arguments = [
"powershell.exe",
# 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_file_path,
"-CertStoreLocation",
"Cert:\\" + pfx_certificate_store_location,
"-Password",
"$mypwd"]
import_pfx_run = subprocess.run(args=import_pfx_arguments, shell=True, stdout=subprocess.PIPE)
if (import_pfx_run.returncode != 0):
print ("ERROR: Could not import PFX certificate into Windows store!")
Expand Down

0 comments on commit 4881c46

Please sign in to comment.