< Summary - Kestrun — Combined Coverage

Information
Class: Public.Tasks.Get-KrTask
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Tasks/Get-KrTask.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 55
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/6) Total lines: 55 Tag: Kestrun/Kestrun@7c4ce528870211ad6c2d2398c31ec13097fc5840

Metrics

Method
Get-KrTask()

File(s)

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

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Gets the status or result of a task by id.
 4.DESCRIPTION
 5    Without -Detailed returns task state; with -Detailed returns TaskResult snapshot.
 6.PARAMETER Server
 7    The Kestrun server instance.
 8.PARAMETER Id
 9    Task id to query.
 10.PARAMETER State
 11    When present, return only the task state string.
 12.EXAMPLE
 13    Get-KrTask -Id 'task-id'
 14
 15    Returns the current state of the specified task.
 16.EXAMPLE
 17    Get-KrTask -Id 'task-id' -Detailed
 18    Returns the detailed result of the specified task.
 19.EXAMPLE
 20    Get-KrTask
 21
 22    Returns a list of all tasks with their current states.
 23.OUTPUTS
 24    When -Detailed is specified, returns a [Kestrun.Tasks.TaskResult] object; otherwise returns a string with the task s
 25    When Id is not specified, returns an array of [Kestrun.Tasks.TaskResult] objects for all tasks.
 26#>
 27function Get-KrTask {
 28    [KestrunRuntimeApi('Everywhere')]
 29    [CmdletBinding(defaultParameterSetName = 'Default')]
 30    [OutputType([Kestrun.Tasks.KrTask[]])]
 31    [OutputType([Kestrun.Tasks.KrTask])]
 32    param(
 33        [Parameter(ValueFromPipeline = $true)]
 34        [Kestrun.Hosting.KestrunHost]$Server,
 35
 36        [Parameter()]
 37        [string]$Id,
 38
 39        [Parameter(parameterSetName = 'State')]
 40        [switch]$State
 41    )
 42    begin {
 043        $Server = Resolve-KestrunServer -Server $Server
 44    }
 45    process {
 046        if ([string]::IsNullOrEmpty($Id)) {
 047            return $Server.Tasks.List()
 48        }
 049        if ($State.IsPresent) {
 050            return $Server.Tasks.GetState($Id)
 51        } else {
 052            return $Server.Tasks.Get($Id)
 53        }
 54    }
 55}

Methods/Properties

Get-KrTask()