Fixes issue on show timer while no default timer was started on ShowAll

This commit is contained in:
Lord Hepipud 2020-08-06 00:17:17 +02:00
parent dcafde1ea7
commit 4898009e86

View file

@ -31,12 +31,12 @@ function Show-IcingaTimer()
$TimerObject = Get-IcingaTimer -Name $Name;
if (-Not $ShowAll) {
if ($null -eq $TimerObject) {
Write-IcingaConsoleNotice 'A timer with the name "{0}" does not exist' -Objects $Name;
return;
}
if (-Not $ShowAll) {
$TimerOutput = New-Object -TypeName PSObject;
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Timer Name' -Value $Name;
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Elapsed Seconds' -Value $TimerObject.Elapsed.TotalSeconds;