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)) { if (0 -eq ($Json.PSObject.Properties.Item($KeyName).Value.Length)) { return '' } else { return $Json.PSObject.Properties.Item($KeyName).Value } } return $null } Export-ModuleMember -Function Get-AppKeyValue |