< Summary - Kestrun — Combined Coverage

Information
Class: Public.Session.Remove-KrSession
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Session/Remove-KrSession.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 26
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/13/2025 - 16:52:37 Line coverage: 0% (0/2) Total lines: 26 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Session/Remove-KrSession.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Removes a session item by key.
 4    .DESCRIPTION
 5        This function accesses the current HTTP context's session and removes the item
 6        associated with the specified key.
 7    .PARAMETER Key
 8        The key of the session item to remove.
 9    .EXAMPLE
 10        Remove-KrSession -Key "username"
 11        Removes the session item associated with the key "username".
 12    .OUTPUTS
 13        None. This function performs a state-changing operation on the session.
 14#>
 15function Remove-KrSession {
 16    [KestrunRuntimeApi('Route')]
 17    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
 18    [CmdletBinding()]
 19    param(
 20        [Parameter(Mandatory)]
 21        [string]$Key
 22    )
 023    if ($null -ne $Context.Session) {
 024        $Context.Session.Remove($Key)
 25    }
 26}

Methods/Properties

Remove-KrSession()