mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Improves certutil output by writing it into eventlog on debug mode
This commit is contained in:
parent
30a7d6f257
commit
d30970b3a9
1 changed files with 9 additions and 1 deletions
|
|
@ -37,9 +37,17 @@ function ConvertTo-IcingaX509Certificate()
|
|||
# it is a temp file or we force its creation
|
||||
if (-Not (Test-Path $TargetFile) -Or $TempFile -Or $Force) {
|
||||
Write-Output "$Password
|
||||
$Password" | certutil -mergepfx "$CertFile" "$TargetFile" | Out-Null;
|
||||
$Password" | certutil -mergepfx "$CertFile" "$TargetFile" | Set-Variable -Name 'CertUtilOutput';
|
||||
}
|
||||
|
||||
Write-IcingaDebugMessage -Message (
|
||||
[string]::Format(
|
||||
'Certutil merge request has been completed. Certutil message:{0}{0}{1}',
|
||||
(New-IcingaNewLine),
|
||||
$CertUtilOutput
|
||||
)
|
||||
);
|
||||
|
||||
# If no target file exists afterwards (a valid PFX certificate)
|
||||
# then throw an exception
|
||||
if (-Not (Test-Path $TargetFile)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue