< Summary - Kestrun — Combined Coverage

Information
Class: Public.SharedState.Get-KrSharedState
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/SharedState/Get-KrSharedState.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 29
Line coverage: 100%
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 08/26/2025 - 01:25:22 Line coverage: 100% (1/1) Total lines: 28 Tag: Kestrun/Kestrun@07f821172e5dc3657f1be7e6818f18d6721cf38a09/04/2025 - 22:37:32 Line coverage: 100% (1/1) Total lines: 29 Tag: Kestrun/Kestrun@afb7aadc0a8a42bfa2b51ea62c8a6e2cf63faec6

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/SharedState/Get-KrSharedState.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Retrieves the value of a previously defined global variable.
 4    .DESCRIPTION
 5        Looks up a variable in the Kestrun global variable table and returns its
 6        value. If the variable does not exist, `$null` is returned.
 7    .PARAMETER Name
 8        Name of the variable to retrieve.
 9        This should be the fully qualified name of the variable, including any
 10        namespaces.
 11    .EXAMPLE
 12        Get-KrSharedState -Name "MyVariable"
 13        This retrieves the value of the global variable "MyVariable".
 14    .NOTES
 15        This function is part of the Kestrun.SharedState module and is used to retrieve the value of global variables.
 16#>
 17function Get-KrSharedState {
 18    [KestrunRuntimeApi('Everywhere')]
 19    [CmdletBinding()]
 20    param(
 21        [Parameter(Mandatory)]
 22        [string]$Name
 23    )
 24    process {
 25        # Retrieve (or $null if not defined)
 126        return [Kestrun.SharedState.SharedStateStore]::Get($Name)
 27    }
 28}
 29

Methods/Properties

Get-KrSharedState()