< Summary - Kestrun — Combined Coverage

Information
Class: Public.Tasks.Start-KrTask
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Tasks/Start-KrTask.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 43
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 10/15/2025 - 01:01:18 Line coverage: 0% (0/3) Total lines: 43 Tag: Kestrun/Kestrun@7c4ce528870211ad6c2d2398c31ec13097fc5840

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Tasks/Start-KrTask.ps1

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Starts a previously created task by id.
 4.DESCRIPTION
 5    Transitions the task from Created state to Running.
 6.PARAMETER Server
 7    The Kestrun server instance.
 8.PARAMETER Id
 9    Task id to start.
 10.PARAMETER WhatIf
 11    Shows what would happen if the cmdlet runs. The cmdlet is not run.
 12.PARAMETER Confirm
 13    Prompts you for confirmation before running the cmdlet.
 14.EXAMPLE
 15    Start-KrTask -Id 'task-id'
 16    Starts the specified task.
 17.NOTES
 18    Requires the Kestrun Task service to be added to the server via Add-KrTasksService.
 19    Returns $true if the task was found and started; $false if the task was not found or could not be started.
 20    A task can only be started once; subsequent attempts to start a task will return $false.
 21    Starting a task is asynchronous; the task will run in the background after being started.
 22    Use Get-KrTask or Get-KrTaskState to monitor the task state.
 23#>
 24function Start-KrTask {
 25    [KestrunRuntimeApi('Everywhere')]
 26    [CmdletBinding(SupportsShouldProcess)]
 27    [OutputType([bool])]
 28    param(
 29        [Parameter(Mandatory = $false, ValueFromPipeline = $true)]
 30        [Kestrun.Hosting.KestrunHost]$Server,
 31
 32        [Parameter(Mandatory)]
 33        [string]$Id
 34    )
 35    begin {
 036        $Server = Resolve-KestrunServer -Server $Server
 37    }
 38    process {
 039        if ($PSCmdlet.ShouldProcess("Task $Id", 'Start')) {
 040            return $Server.Tasks.Start($Id)
 41        }
 42    }
 43}

Methods/Properties

Start-KrTask()