ps/Modules/Alkami.PowerShell.Configuration/Public/Get-ConfigSetting.ps1

23 lines
635 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Get-ConfigSetting {
<#
.SYNOPSIS
This function will get the config setting on the machine starting with the machine.config, and progressing to the environment variables
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
[Alias("Name")]
[string]$Key
)
$logLead = (Get-LogLeadName)
$settingValue = (Get-AppSetting -Key $Key)
if ($null -eq $settingValue) {
Write-Verbose "$logLead : Setting not found in machine config, trying environment variables"
$settingValue = (Get-EnvironmentVariable -Key $Key)
}
return $settingValue
}