icinga-powershell-framework/lib/daemons/RestAPI/threads/Start-IcingaForWindowsRESTThread.psm1

20 lines
577 B
PowerShell
Raw Normal View History

function Start-IcingaForWindowsRESTThread()
{
param (
[int]$ThreadId = 0,
[switch]$RequireAuth = $FALSE
);
# Now create a new thread, assign a name and parse all required arguments to it.
# Last but not least start it directly
New-IcingaThreadInstance `
2021-12-09 11:42:06 -05:00
-Name 'CheckThread' `
-ThreadPool (New-IcingaThreadPool -MaxInstances 1) `
-Command 'New-IcingaForWindowsRESTThread' `
-CmdParameters @{
2021-12-09 11:42:06 -05:00
'RequireAuth' = $RequireAuth;
'ThreadId' = $ThreadId;
} `
-Start;
}