icinga-powershell-framework/lib/daemons/RestAPI/threads/Start-IcingaForWindowsRESTThread.psm1
2022-03-18 22:54:43 +01:00

20 lines
604 B
PowerShell

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 `
-Name 'CheckThread' `
-ThreadPool (New-IcingaThreadPool -MaxInstances 1) `
-Command 'New-IcingaForWindowsRESTThread' `
-CmdParameters @{
'RequireAuth' = $RequireAuth;
'ThreadId' = $ThreadId;
} `
-Start `
-CheckAliveState;
}