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