Найти в Дзене
IT, Python, Mikrotik, Linux

Установка сертификатов в доверенные корневые центры

💬 Наш канал: 👉 proit_world # Install multiple certificates to LocalMachine\Root # Make sure to run this script as Administrator $certificates = @( "C:\Users\Public\you.cert.crt", "C:\Users\Public\you.cert.crt", "C:\Users\Public\you.cert.crt", "C:\Users\Public\you.cert.crt" ) foreach ($certPath in $certificates) { Write-Host "Installing certificate: $certPath" if (Test-Path $certPath) { try { Import-Certificate -FilePath $certPath -CertStoreLocation "Cert:\LocalMachine\Root" -ErrorAction Stop | Out-Null Write-Host "OK: $certPath installed successfully." -ForegroundColor Green } catch { Write-Host "FAILED: Could not install $certPath" -ForegroundColor Red Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red } } else { Write-Host "FAILED: File not found at $certPath" -ForegroundColor Yellow } Write-Host "" } Pause #windows #powershell

💬 Наш канал: 👉 proit_world

# Install multiple certificates to LocalMachine\Root

# Make sure to run this script as Administrator

$certificates = @(

"C:\Users\Public\you.cert.crt",

"C:\Users\Public\you.cert.crt",

"C:\Users\Public\you.cert.crt",

"C:\Users\Public\you.cert.crt"

)

foreach ($certPath in $certificates) {

Write-Host "Installing certificate: $certPath"

if (Test-Path $certPath) {

try {

Import-Certificate -FilePath $certPath -CertStoreLocation "Cert:\LocalMachine\Root" -ErrorAction Stop | Out-Null

Write-Host "OK: $certPath installed successfully." -ForegroundColor Green

}

catch {

Write-Host "FAILED: Could not install $certPath" -ForegroundColor Red

Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red

}

}

else {

Write-Host "FAILED: File not found at $certPath" -ForegroundColor Yellow

}

Write-Host ""

}

Pause

#windows #powershell