< Summary - Kestrun — Combined Coverage

Information
Class: Public.Runtime.Test-KrCapability
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Runtime/Test-KrCapability.ps1
Tag: Kestrun/Kestrun@eeafbe813231ed23417e7b339e170e307b2c86f9
Line coverage
57%
Covered lines: 4
Uncovered lines: 3
Coverable lines: 7
Total lines: 46
Line coverage: 57.1%
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/13/2025 - 16:52:37 Line coverage: 0% (0/3) Total lines: 31 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e03/04/2026 - 19:40:34 Line coverage: 57.1% (4/7) Total lines: 46 Tag: Kestrun/Kestrun@eeafbe813231ed23417e7b339e170e307b2c86f9

Coverage delta

Coverage delta 58 -58

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Runtime/Test-KrCapability.ps1

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Check if a specific feature is supported in the current Kestrun runtime environment.
 4.DESCRIPTION
 5    This cmdlet checks if a given feature, identified by its name, is supported in the current Kestrun runtime environme
 6    It can be used to determine if certain capabilities are available based on the runtime version and configuration.
 7    For HTTP/3 checks, this cmdlet also verifies platform QUIC availability.
 8.PARAMETER Feature
 9    The name of the feature to check. This can be either the name of a KnownFeature enum value or a raw string represent
 10.EXAMPLE
 11    Test-KrCapability -Feature "Http3"
 12    This example checks if HTTP/3 is supported and QUIC is available on the current platform/runtime.
 13.EXAMPLE
 14    Test-KrCapability -Feature "Quic"
 15    This example checks if QUIC is available using Kestrun host capability detection.
 16.EXAMPLE
 17    Test-KrCapability -Feature "SomeOtherFeature"
 18    This example checks if a feature named "SomeOtherFeature" is supported, using a raw string.
 19#>
 20function Test-KrCapability {
 21    [KestrunRuntimeApi('Everywhere')]
 22    [CmdletBinding()]
 23    [OutputType([bool])]
 24    param(
 25        [Parameter(Mandatory)]
 26        [string]$Feature
 27    )
 28
 29    # HTTP/3 capability: relies on runtime feature support (which already checks QUIC availability)
 230    if ($Feature -in @('Http3', 'Http3Support')) {
 131        return [Kestrun.KestrunRuntimeInfo]::Supports('Http3')
 32    }
 33
 34    # QUIC capability: reflects platform QUIC availability via Kestrun host detection
 235    if ($Feature -in @('Quic', 'QuicSupport')) {
 136        return [Kestrun.Hosting.KestrunHost]::IsQuicSupported()
 37    }
 38
 39    # Allow either enum name or raw string
 40    try {
 041        $enum = [Kestrun.KestrunRuntimeInfo+KnownFeature]::$Feature
 042        return [Kestrun.KestrunRuntimeInfo]::Supports($enum)
 43    } catch [System.ArgumentException] {
 044        return [Kestrun.KestrunRuntimeInfo]::Supports($Feature)
 45    }
 46}

Methods/Properties

Test-KrCapability()