mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
30 lines
560 B
PowerShell
30 lines
560 B
PowerShell
|
|
function Write-IcingaTestOutput()
|
||
|
|
{
|
||
|
|
param(
|
||
|
|
[ValidateSet('PASSED', 'WARNING', 'FAILED')]
|
||
|
|
$Severity,
|
||
|
|
$Message
|
||
|
|
);
|
||
|
|
|
||
|
|
$Color = 'Green';
|
||
|
|
|
||
|
|
Switch ($Severity) {
|
||
|
|
'PASSED' {
|
||
|
|
$Color = 'Green';
|
||
|
|
break;
|
||
|
|
};
|
||
|
|
'WARNING' {
|
||
|
|
$Color = 'Yellow';
|
||
|
|
break;
|
||
|
|
};
|
||
|
|
'FAILED' {
|
||
|
|
$Color = 'Red';
|
||
|
|
break;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-Host '[' -NoNewline;
|
||
|
|
Write-Host $Severity -ForegroundColor $Color -NoNewline;
|
||
|
|
Write-Host ']:' $Message;
|
||
|
|
}
|