Fixes x509 cert conversion to only delete temp files not output files

This commit is contained in:
Christian Stein 2020-03-26 07:32:20 +01:00
parent 90ef20a7e5
commit 8a19899fff

View file

@ -41,7 +41,9 @@ function ConvertTo-IcingaX509Certificate()
# Now load the actual certificate from the path # Now load the actual certificate from the path
$Certificate = New-Object Security.Cryptography.X509Certificates.X509Certificate2 $TargetFile; $Certificate = New-Object Security.Cryptography.X509Certificates.X509Certificate2 $TargetFile;
# Delete the PFX-Certificate which will be present after certutil merge # Delete the PFX-Certificate which will be present after certutil merge
if ($TempFile) {
Remove-Item $TargetFile -Force -ErrorAction SilentlyContinue; Remove-Item $TargetFile -Force -ErrorAction SilentlyContinue;
}
# Return the certificate # Return the certificate
return $Certificate return $Certificate