Pipelines/Steps/Install/OnPrem/Sitecore/SSL/New-RootCert.ps1

$ErrorActionPreference = "Stop"

$rootCertName = BuildSitecoreRootCertName -Prefix $SAFConfiguration.prefix
$exportPath = Get-Location

$certDestPath = Join-Path -Path $exportPath -ChildPath "SitecoreRootSSLCertificate_SAF.pfx"
if (Test-Path $certDestPath) {
    Write-Warning "It seems that you alredy have SitecoreRootSSLCertificate_SAF.pfx SSL certificate. Skipping creation..."
    Start-Sleep -s 5
}
else {
    GenerateRootCert -RootCertName $rootCertName
    ExportCert -CertName $rootCertName -PfxName "SitecoreRootSSLCertificate_SAF.pfx" -ExportPath $exportPath -Password $SAFDefaultPFXPassword
}