< 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@9d3a582b2d63930269564a7591aa77ef297cadeb
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

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