mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixes issue on show timer while no default timer was started on ShowAll
This commit is contained in:
parent
dcafde1ea7
commit
4898009e86
1 changed files with 5 additions and 5 deletions
|
|
@ -31,12 +31,12 @@ function Show-IcingaTimer()
|
||||||
|
|
||||||
$TimerObject = Get-IcingaTimer -Name $Name;
|
$TimerObject = Get-IcingaTimer -Name $Name;
|
||||||
|
|
||||||
|
if (-Not $ShowAll) {
|
||||||
if ($null -eq $TimerObject) {
|
if ($null -eq $TimerObject) {
|
||||||
Write-IcingaConsoleNotice 'A timer with the name "{0}" does not exist' -Objects $Name;
|
Write-IcingaConsoleNotice 'A timer with the name "{0}" does not exist' -Objects $Name;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-Not $ShowAll) {
|
|
||||||
$TimerOutput = New-Object -TypeName PSObject;
|
$TimerOutput = New-Object -TypeName PSObject;
|
||||||
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Timer Name' -Value $Name;
|
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Timer Name' -Value $Name;
|
||||||
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Elapsed Seconds' -Value $TimerObject.Elapsed.TotalSeconds;
|
$TimerOutput | Add-Member -MemberType NoteProperty -Name 'Elapsed Seconds' -Value $TimerObject.Elapsed.TotalSeconds;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue