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 try { if ($null -ne $Json.PSObject.Properties.Item($KeyName)) { return $Json.PSObject.Properties.Item($KeyName).Value } else { return '' } } catch { throw "Could not find $KeyName in app.json" } } Export-ModuleMember -Function Get-AppKeyValue |