Private/Get-KadenReleaseChannel.ps1
|
function Get-KadenReleaseChannel { <# .SYNOPSIS Read the release channel packaged with this installed module. .DESCRIPTION The installed payload decides. Only the literal value ga is general availability. A missing file, unreadable file, or any other value stays on the beta path. #> [CmdletBinding()] param() $channelPath = Join-Path (Get-KadenPayloadRoot) 'kaden-release-channel.json' if (-not (Test-Path -LiteralPath $channelPath)) { return 'beta' } try { $doc = Get-Content -LiteralPath $channelPath -Raw -ErrorAction Stop | ConvertFrom-Json } catch { return 'beta' } $channel = '' if ($null -ne $doc -and $null -ne $doc.PSObject.Properties['releaseChannel']) { $channel = [string]$doc.releaseChannel } if ($channel -eq 'ga') { return 'ga' } return 'beta' } |