mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
18 lines
399 B
PowerShell
18 lines
399 B
PowerShell
|
|
function Remove-IcingaThread()
|
||
|
|
{
|
||
|
|
param(
|
||
|
|
[string]$Thread
|
||
|
|
);
|
||
|
|
|
||
|
|
if ([string]::IsNullOrEmpty($Thread)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
Stop-IcingaThread -Thread $Thread;
|
||
|
|
|
||
|
|
if ($global:IcingaDaemonData.IcingaThreads.ContainsKey($Thread)) {
|
||
|
|
$global:IcingaDaemonData.IcingaThreads[$Thread].Shell.Dispose();
|
||
|
|
$global:IcingaDaemonData.IcingaThreads.Remove($Thread);
|
||
|
|
}
|
||
|
|
}
|