< 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@5f1d2b981c9d7292c11fd448428c6ab6c811c5de
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 11/19/2025 - 17:40:50 Line coverage: 0% (0/2) Total lines: 26 Tag: Kestrun/Kestrun@fcf33342333cef0516fe0d0912a86709874fd026

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()