icinga-powershell-framework/lib/core/thread/Remove-IcingaThread.psm1

20 lines
452 B
PowerShell
Raw Normal View History

function Remove-IcingaThread()
{
param(
2022-03-18 15:58:56 -04:00
[string]$Thread = ''
);
if ([string]::IsNullOrEmpty($Thread)) {
return;
}
Stop-IcingaThread -Thread $Thread;
2021-12-09 11:42:06 -05:00
if ($Global:Icinga.Public.Threads.ContainsKey($Thread)) {
$Global:Icinga.Public.Threads[$Thread].Shell.Dispose();
$Global:Icinga.Public.Threads.Remove($Thread);
Write-IcingaDebugMessage 'Removing Thread: {0}' -Objects $Thread;
}
}