mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
18 lines
540 B
PowerShell
18 lines
540 B
PowerShell
function Stop-IcingaThread()
|
|
{
|
|
param(
|
|
[string]$Thread
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($Thread)) {
|
|
return;
|
|
}
|
|
|
|
if ($global:IcingaDaemonData.IcingaThreads.ContainsKey($Thread)) {
|
|
if ($global:IcingaDaemonData.IcingaThreads[$Thread].Started -eq $TRUE) {
|
|
$global:IcingaDaemonData.IcingaThreads[$Thread].Shell.Stop();
|
|
$global:IcingaDaemonData.IcingaThreads[$Thread].Handle = $null;
|
|
$global:IcingaDaemonData.IcingaThreads[$Thread].Started = $FALSE;
|
|
}
|
|
}
|
|
}
|