icinga-powershell-framework/lib/core/icingaagent/writers/Write-IcingaTestOutput.psm1

30 lines
560 B
PowerShell
Raw Normal View History

2019-09-29 12:25:40 -04:00
function Write-IcingaTestOutput()
{
param(
[ValidateSet('Passed', 'Warning', 'Failed')]
2019-09-29 12:25:40 -04:00
$Severity,
$Message
);
$Color = 'Green';
Switch ($Severity) {
'Passed' {
2019-09-29 12:25:40 -04:00
$Color = 'Green';
break;
};
'Warning' {
2019-09-29 12:25:40 -04:00
$Color = 'Yellow';
break;
};
'Failed' {
2019-09-29 12:25:40 -04:00
$Color = 'Red';
break;
};
}
Write-Host '[' -NoNewline;
Write-Host $Severity -ForegroundColor $Color -NoNewline;
Write-Host ']:' $Message;
}