< Summary - Kestrun — Combined Coverage

Information
Class: Private.Logging.Write-KrOutsideRouteWarning
Assembly: Kestrun.PowerShell.Private
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Logging/Write-KrOutsideRouteWarning.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 25
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 09/12/2025 - 03:43:11 Line coverage: 0% (0/3) Total lines: 25 Tag: Kestrun/Kestrun@d160286e3020330b1eb862d66a37db2e26fc9042

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Private/Logging/Write-KrOutsideRouteWarning.ps1

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Logs a warning that a function must be called inside a route script block.
 4.DESCRIPTION
 5    This function logs a warning message indicating that a specific function must be called within a route script
 6    block where the $Context variable is available.
 7.PARAMETER FunctionName
 8    The name of the function that is being called outside of a route script block.
 9    Defaults to the name of the calling function.
 10.EXAMPLE
 11    Write-KrOutsideRouteWarning -FunctionName 'Invoke-KrCookieSignIn'
 12    This example logs a warning that 'Invoke-KrCookieSignIn' must be called inside a route script block.
 13.NOTES
 14    This function is intended for internal use within the Kestrun framework.
 15#>
 16function Write-KrOutsideRouteWarning {
 17    param (
 18        [string]$FunctionName = $PSCmdlet.MyInvocation.InvocationName
 19    )
 020    if (Test-KrLogger) {
 021        Write-KrLog -Level Warning -Message '{function} must be called inside a route script block where $Context is ava
 22    } else {
 023        Write-Warning -Message "$FunctionName must be called inside a route script block where `$Context is available."
 24    }
 25}

Methods/Properties

Write-KrOutsideRouteWarning()