mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
18 lines
501 B
PowerShell
18 lines
501 B
PowerShell
function Stop-IcingaThread()
|
|
{
|
|
param (
|
|
[string]$Thread = ''
|
|
);
|
|
|
|
if ([string]::IsNullOrEmpty($Thread)) {
|
|
return;
|
|
}
|
|
|
|
if ($Global:Icinga.Public.Threads.ContainsKey($Thread)) {
|
|
if ($Global:Icinga.Public.Threads[$Thread].Started -eq $TRUE) {
|
|
$Global:Icinga.Public.Threads[$Thread].Shell.Stop();
|
|
$Global:Icinga.Public.Threads[$Thread].Handle = $null;
|
|
$Global:Icinga.Public.Threads[$Thread].Started = $FALSE;
|
|
}
|
|
}
|
|
}
|