icinga-powershell-framework/lib/core/framework/Test-IcingaTimer.psm1

36 lines
880 B
PowerShell
Raw Normal View History

<#
.SYNOPSIS
2021-12-09 11:42:06 -05:00
Tests if a specific timer object is already present and started with Start-IcingaTimer
.DESCRIPTION
2021-12-09 11:42:06 -05:00
Tests if a specific timer object is already present and started with Start-IcingaTimer
.FUNCTIONALITY
2021-12-09 11:42:06 -05:00
Tests if a specific timer object is already present and started with Start-IcingaTimer
.EXAMPLE
2021-12-09 11:42:06 -05:00
PS>Test-IcingaTimer;
.EXAMPLE
2021-12-09 11:42:06 -05:00
PS>Test-IcingaTimer -Name 'My Test Timer';
.PARAMETER Name
2021-12-09 11:42:06 -05:00
The name of a custom identifier to run mutliple timers at once
.INPUTS
2021-12-09 11:42:06 -05:00
System.String
.OUTPUTS
2021-12-09 11:42:06 -05:00
Boolean
.LINK
2021-12-09 11:42:06 -05:00
https://github.com/Icinga/icinga-powershell-framework
#>
function Test-IcingaTimer()
{
param (
[string]$Name = 'DefaultTimer'
);
2021-12-09 11:42:06 -05:00
$TimerData = Get-IcingaHashtableItem -Key $Name -Hashtable $Global:Icinga.Private.Timers;
if ($null -eq $TimerData) {
return $FALSE;
}
return $TimerData.Active;
}