31 lines
918 B
PowerShell
31 lines
918 B
PowerShell
function Get-ValidatedRuntimeParameter {
|
|
<#
|
|
.SYNOPSIS
|
|
Allows for validating runtime parameter to ensure consistency.
|
|
|
|
.PARAMETER Runtime
|
|
Appropriate values are core, dotnetcore, framework, legacy
|
|
|
|
.OUTPUTS
|
|
dotnetcore, framework, as appropriate
|
|
|
|
.NOTES
|
|
Used in Alkami.Installer.Service, Alkami.Installer.Migrations to validate the runtime value
|
|
Used in Get-PackageMetadataV2 to validate the runtime value
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([string])]
|
|
param (
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$Runtime
|
|
)
|
|
|
|
$logLead = Get-LogLeadName
|
|
|
|
switch ($Runtime) {
|
|
{ "framework","legacy" -eq $_ } { return "framework" }
|
|
{ "dotnetcore","core" -eq $_ } { return "dotnetcore" }
|
|
default { throw "$logLead : [$_] is not allowed as a valid runtime. Please consult with SRE for adding additional runtimes." }
|
|
}
|
|
} |