icinga-powershell-framework/lib/core/thread/New-IcingaThreadPool.psm1
2019-10-05 21:59:03 +02:00

18 lines
375 B
PowerShell

function New-IcingaThreadPool()
{
param(
[int]$MinInstances = 1,
[int]$MaxInstances = 5
);
$Runspaces = [RunspaceFactory]::CreateRunspacePool(
$MinInstances,
$MaxInstances,
[System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault(),
$host
)
$Runspaces.Open();
return $Runspaces;
}