Add first script

This commit is contained in:
helmut 2026-04-16 16:59:38 +05:00
commit 157c4f2b3b
2 changed files with 32 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

31
installSSL.ps1 Normal file
View File

@ -0,0 +1,31 @@
# ==========================================
# 📥 ШАГ 1: Установка сертификата в систему
# ==========================================
# Путь к файлу PFX
$PfxPath = "C:\edo\Help-D_RDP.pfx"
$PfxPassword = "sj032ssa"
Write-Host "⏳ Импорт сертификата..." -ForegroundColor Cyan
try {
$SecurePass = ConvertTo-SecureString -String $PfxPassword -AsPlainText -Force
# 1. Доверенные корневые центры (Доверие цепочке)
Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\LocalMachine\Root -Password $SecurePass | Out-Null
# 2. Доверенные издатели (Убирает предупреждение "Неизвестный издатель")
Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\LocalMachine\TrustedPublisher -Password $SecurePass | Out-Null
# 3. Личное хранилище (Доступ к приватному ключу для подписи)
$Cert = Import-PfxCertificate -FilePath $PfxPath -CertStoreLocation Cert:\LocalMachine\My -Password $SecurePass -Exportable
$Thumb = $Cert.Thumbprint
Write-Host "✅ Сертификат успешно установлен." -ForegroundColor Green
Write-Host "📋 Скопируйте этот отпечаток для Шага 2:" -ForegroundColor Yellow
Write-Host "------------------------------------------------"
Write-Host "$Thumb" -ForegroundColor White -BackgroundColor DarkBlue
Write-Host "------------------------------------------------"
} catch {
Write-Error "❌ Ошибка установки: $_"
}