< Summary - Kestrun — Combined Coverage

Information
Class: Public.Service.Add-KrScheduling
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Service/Add-KrScheduling.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 54
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 08/26/2025 - 01:25:22 Line coverage: 0% (0/6) Total lines: 53 Tag: Kestrun/Kestrun@07f821172e5dc3657f1be7e6818f18d6721cf38a09/04/2025 - 18:11:31 Line coverage: 0% (0/6) Total lines: 54 Tag: Kestrun/Kestrun@de99e24698289f3f61ac7b73e96092732ae12b0509/08/2025 - 20:34:03 Line coverage: 0% (0/8) Total lines: 58 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7210/13/2025 - 16:52:37 Line coverage: 0% (0/6) Total lines: 54 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Service/Add-KrScheduling.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Adds scheduling support to the Kestrun server.
 4    .DESCRIPTION
 5        This cmdlet allows you to register a scheduling service with the Kestrun server.
 6        It can be used to manage scheduled tasks and jobs in the context of the Kestrun server.
 7    .PARAMETER Server
 8        The Kestrun server instance to which the scheduling service will be added.
 9    .PARAMETER MaxRunspaces
 10        The maximum number of runspaces to use for scheduling tasks. If not specified, defaults to 0 (unlimited).
 11    .PARAMETER PassThru
 12        If specified, the cmdlet will return the modified server instance after adding the scheduling service.
 13    .EXAMPLE
 14        $server | Add-KrScheduling -MaxRunspaces 5
 15        This example adds scheduling support to the server, with a maximum of 5 runspaces.
 16    .EXAMPLE
 17        $server | Add-KrScheduling
 18        This example adds scheduling support to the server without specifying a maximum number of runspaces.
 19    .NOTES
 20        This cmdlet is used to register a scheduling service with the Kestrun server, allowing you to manage scheduled t
 21#>
 22function Add-KrScheduling {
 23    [KestrunRuntimeApi('Definition')]
 24    [CmdletBinding()]
 25    [OutputType([Kestrun.Hosting.KestrunHost])]
 26    param(
 27        [Parameter(Mandatory = $false, ValueFromPipeline = $true)]
 28        [Kestrun.Hosting.KestrunHost]$Server,
 29
 30        [Parameter()]
 31        [int]$MaxRunspaces,
 32
 33        [Parameter()]
 34        [switch]$PassThru
 35    )
 36    begin {
 37        # Ensure the server instance is resolved
 038        $Server = Resolve-KestrunServer -Server $Server
 39    }
 40    process {
 041        if ($MaxRunspaces -eq 0) {
 42            # If MaxRunspaces is 0, use the default configuration
 043            $Server.AddScheduling() | Out-Null
 44        } else {
 045            $Server.AddScheduling($MaxRunspaces) | Out-Null
 46        }
 47
 048        if ($PassThru.IsPresent) {
 49            # if the PassThru switch is specified, return the modified server instance
 050            return $Server
 51        }
 52    }
 53}
 54

Methods/Properties

Add-KrScheduling()