From 4898009e8675190f4f04ddd6df1dd83a0b99b436 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Thu, 6 Aug 2020 00:17:17 +0200 Subject: [PATCH] Fixes issue on show timer while no default timer was started on ShowAll --- lib/core/framework/Show-IcingaTimer.psm1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/framework/Show-IcingaTimer.psm1 b/lib/core/framework/Show-IcingaTimer.psm1 index 7a5b430..ed0be28 100644 --- a/lib/core/framework/Show-IcingaTimer.psm1 +++ b/lib/core/framework/Show-IcingaTimer.psm1 @@ -31,12 +31,12 @@ function Show-IcingaTimer() $TimerObject = Get-IcingaTimer -Name $Name; - if ($null -eq $TimerObject) { - Write-IcingaConsoleNotice 'A timer with the name "{0}" does not exist' -Objects $Name; - return; - } - if (-Not $ShowAll) { + if ($null -eq $TimerObject) { + Write-IcingaConsoleNotice 'A timer with the name "{0}" does not exist' -Objects $Name; + return; + } + $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;