mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Improves console output for certain commands
This commit is contained in:
parent
882ce624a0
commit
987a52c418
3 changed files with 5 additions and 5 deletions
|
|
@ -194,7 +194,7 @@ function Test-IcingaAgentCertificates()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-IcingaConsoleNotice 'Icinga host certificates are present and valid. No generation required.';
|
Write-IcingaConsoleNotice 'Icinga host certificates are present and valid. No generation required';
|
||||||
|
|
||||||
return $TRUE;
|
return $TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,20 @@ function Uninstall-IcingaAgent()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-IcingaConsoleNotice 'Removing current installed Icinga Agent';
|
Write-IcingaConsoleNotice 'Removing current Icinga Agent';
|
||||||
|
|
||||||
Stop-IcingaService 'icinga2';
|
Stop-IcingaService 'icinga2';
|
||||||
|
|
||||||
$Uninstaller = Start-IcingaProcess -Executable 'MsiExec.exe' -Arguments ([string]::Format('{0} /q', $IcingaData.Uninstaller)) -FlushNewLine;
|
$Uninstaller = Start-IcingaProcess -Executable 'MsiExec.exe' -Arguments ([string]::Format('{0} /q', $IcingaData.Uninstaller)) -FlushNewLine;
|
||||||
|
|
||||||
if ($Uninstaller.ExitCode -ne 0) {
|
if ($Uninstaller.ExitCode -ne 0) {
|
||||||
Write-IcingaConsoleError ([string]::Format('Failed to remove Icinga 2 Agent: {0}{1}', $Uninstaller.Message, $Uninstaller.Error));
|
Write-IcingaConsoleError ([string]::Format('Failed to remove Icinga Agent: {0}{1}', $Uninstaller.Message, $Uninstaller.Error));
|
||||||
return $FALSE;
|
return $FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($RemoveDataFolder) {
|
if ($RemoveDataFolder) {
|
||||||
[string]$IcingaProgramData = Join-Path -Path $Env:ProgramData -ChildPath 'icinga2';
|
[string]$IcingaProgramData = Join-Path -Path $Env:ProgramData -ChildPath 'icinga2';
|
||||||
Write-IcingaConsoleNotice -Message 'Removing Icinga 2 directoy from ProgramData: "{0}"' -Objects $IcingaProgramData;
|
Write-IcingaConsoleNotice -Message 'Removing Icinga Agent directory: "{0}"' -Objects $IcingaProgramData;
|
||||||
if ((Remove-ItemSecure -Path $IcingaProgramData -Recurse -Force) -eq $FALSE) {
|
if ((Remove-ItemSecure -Path $IcingaProgramData -Recurse -Force) -eq $FALSE) {
|
||||||
return $FALSE;
|
return $FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ function Move-IcingaAgentDefaultConfig()
|
||||||
$BackupFile = Join-Path -Path $ConfigDir -ChildPath 'ps_backup\backup_executed.key';
|
$BackupFile = Join-Path -Path $ConfigDir -ChildPath 'ps_backup\backup_executed.key';
|
||||||
|
|
||||||
if ((Test-Path $BackupFile)) {
|
if ((Test-Path $BackupFile)) {
|
||||||
Write-IcingaConsoleNotice 'A backup of your default configuration is not required. A backup was already made.';
|
Write-IcingaConsoleNotice 'A backup of your default configuration is not required. A backup was already made';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue