mirror of
https://github.com/danog/code-server.git
synced 2024-12-15 02:37:27 +01:00
be3e823608
git-subtree-dir: lib/vscode git-subtree-split: e5a624b788d92b8d34d1392e4c4d9789406efe8f
15 lines
701 B
PowerShell
15 lines
701 B
PowerShell
param ($CertBase64)
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$CertBytes = [System.Convert]::FromBase64String($CertBase64)
|
|
$CertCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
|
|
$CertCollection.Import($CertBytes, $null, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
|
|
|
|
$CertStore = New-Object System.Security.Cryptography.X509Certificates.X509Store("My","LocalMachine")
|
|
$CertStore.Open("ReadWrite")
|
|
$CertStore.AddRange($CertCollection)
|
|
$CertStore.Close()
|
|
|
|
$ESRPAuthCertificateSubjectName = $CertCollection[0].Subject
|
|
Write-Output ("##vso[task.setvariable variable=ESRPAuthCertificateSubjectName;]$ESRPAuthCertificateSubjectName")
|