PDA

Показать полную графическую версию : Поженить cmd/bat и powershell


Страниц : 1 [2]

DJ Mogarych
04-04-2023, 22:14
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\folder\mycertificate.cer")
$rootStore = Get-Item cert:\LocalMachine\Root
$rootStore.Open("ReadWrite")
$rootStore.Add($cert)
$rootStore.Close()


https://www.appveyor.com/docs/deployment/local/#installing-self-signed-ssl-certificate-to-a-website
https://social.technet.microsoft.com/Forums/lync/en-US/aac8cfcd-6bd2-423f-895b-a6612459eb16/importcertificate-without-confirmation-ignore-security-warnings?forum=winserverpowershell

sov44
05-04-2023, 08:30
К сожалению и этот сценарий не сработал https://imgsh.net/a/VEYM8xe.png. Возможно причина проблемы в контейнере sst?
4.ps1
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("c:\cert\CU_RootCertBackup.sst")
$rootStore = Get-Item cert:\CurrentUser\Root
$rootStore.Open("ReadWrite")
$rootStore.Add($cert)
$rootStore.Close()

Прикрепил для тестов файл CU_RootCertBackup.sst

DJ Mogarych
05-04-2023, 10:02
Get-ChildItem -Path C:\temp\CU_RootCertBackup.sst |Import-Certificate -CertStoreLocation cert:\LocalMachine\Root

https://social.technet.microsoft.com/Forums/en-US/b32c2bab-b73e-4139-a8b7-86dad08f8a1e/export-amp-import-sst-microsoft-serialized-certificate-store?forum=winserversecurity




© OSzone.net 2001-2012