mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
19 lines
452 B
PowerShell
19 lines
452 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;
|
|
}
|
|
}
|