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

19 lines
447 B
PowerShell

function Remove-IcingaThread()
{
param(
[string]$Thread
);
if ([string]::IsNullOrEmpty($Thread)) {
return;
}
Stop-IcingaThread -Thread $Thread;
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;
}
}