AL/Get-AppSourceCopKeyValue.ps1
function Get-AppSourceCopKeyValue { Param( [Parameter(Mandatory=$false)] [string]$SourcePath = (Get-Location), [Parameter(Mandatory=$true)] [string]$KeyName ) if (!(Test-Path (Join-Path $SourcePath 'AppSourceCop.json'))) { return $null } $JsonContent = Get-Content (Join-Path $SourcePath 'AppSourceCop.json') -Raw $Json = ConvertFrom-Json $JsonContent if ($null -ne $Json.PSObject.Properties.Item($KeyName)) { return $Json.PSObject.Properties.Item($KeyName).Value } return $null } Export-ModuleMember -Function Get-AppSourceCopKeyValue |