AL/Get-AppKeyValue.ps1

function Get-AppKeyValue {
    Param(
        [Parameter(Mandatory=$false)]
        [string]$SourcePath = (Get-Location),
        [Parameter(Mandatory=$true)]
        [string]$KeyName
    )

    $JsonContent = Get-Content (Join-Path $SourcePath 'app.json') -Raw
    $Json = ConvertFrom-Json $JsonContent

    if ($null -ne  $Json.PSObject.Properties.Item($KeyName)) {
        return $Json.PSObject.Properties.Item($KeyName).Value
    }
    else {
        return ''
    }
}

Export-ModuleMember -Function Get-AppKeyValue