icinga-powershell-framework/lib/core/thread/Start-IcingaThread.psm1
2022-01-25 10:00:19 +01:00

17 lines
483 B
PowerShell

function Start-IcingaThread()
{
param(
[string]$Thread
);
if ([string]::IsNullOrEmpty($Thread)) {
return;
}
if ($Global:Icinga.Public.Threads.ContainsKey($Thread)) {
if ($Global:Icinga.Public.Threads[$Thread].Started -eq $FALSE) {
$Global:Icinga.Public.Threads[$Thread].Handle = $Global:Icinga.Public.Threads[$Thread].Shell.BeginInvoke();
$Global:Icinga.Public.Threads[$Thread].Started = $TRUE;
}
}
}