< Summary - Kestrun — Combined Coverage

Information
Class: Public.Request.Get-KrRequestQuery
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Request/Get-KrRequestQuery.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 29
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

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Request/Get-KrRequestQuery.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Retrieves a query parameter value from the HTTP request.
 4    .DESCRIPTION
 5        This function accesses the current HTTP request context and retrieves the value
 6        of the specified query parameter by name.
 7    .PARAMETER Name
 8        The name of the query parameter to retrieve from the HTTP request.
 9    .EXAMPLE
 10        $value = Get-KrRequestQuery -Name "param1"
 11        Retrieves the value of the query parameter "param1" from the HTTP request.
 12    .OUTPUTS
 13        Returns the value of the specified query parameter, or $null if not found.
 14    .NOTES
 15        This function is designed to be used in the context of a Kestrun server response.
 16#>
 17function Get-KrRequestQuery {
 18    [KestrunRuntimeApi('Route')]
 19    [CmdletBinding()]
 20    param(
 21        [Parameter(Mandatory = $true)]
 22        [string]$Name
 23    )
 024    if ($null -ne $Context.Request) {
 25        # Get the query parameter value from the request
 026        return $Context.Request.Query[$Name]
 27    }
 28}
 29

Methods/Properties

Get-KrRequestQuery()