mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixes x509 cert conversion to only delete temp files not output files
This commit is contained in:
parent
90ef20a7e5
commit
8a19899fff
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||||
Remove-Item $TargetFile -Force -ErrorAction SilentlyContinue;
|
if ($TempFile) {
|
||||||
|
Remove-Item $TargetFile -Force -ErrorAction SilentlyContinue;
|
||||||
|
}
|
||||||
|
|
||||||
# Return the certificate
|
# Return the certificate
|
||||||
return $Certificate
|
return $Certificate
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue