Add debug output for starting new thread instances

This commit is contained in:
Christian Stein 2020-03-24 20:09:50 +01:00
parent 9b947dc069
commit df7be4a317

View file

@ -12,6 +12,15 @@ function New-IcingaThreadInstance()
$Name = New-IcingaThreadHash -ShellScript $ScriptBlock -Arguments $Arguments; $Name = New-IcingaThreadHash -ShellScript $ScriptBlock -Arguments $Arguments;
} }
Write-IcingaDebugMessage -Message (
[string]::Format(
'Creating new thread instance {0}{1}Arguments:{1}{2}',
$Name,
"`r`n",
($Arguments | Out-String)
)
);
$Shell = [PowerShell]::Create(); $Shell = [PowerShell]::Create();
$Shell.RunspacePool = $ThreadPool; $Shell.RunspacePool = $ThreadPool;
[void]$Shell.AddScript($ScriptBlock); [void]$Shell.AddScript($ScriptBlock);