kine/NVRAppDevOps

Dynamic readout of the settings

Closed this issue · 1 comments

So far the path to the settings file/script is hardcoded in the PowerShell function. Wouldn't it be much better to parameterize this path as well or to configure it somewhere? So it would be much easier to use it for other DevOps scenarios without adjustments.

$SettingsScript = (Join-Path $Path 'Scripts\Settings.ps1')
if (Test-Path $SettingsScript) {
Write-Host "Running $SettingsScript ..."
. (Join-Path $Path 'Scripts\Settings.ps1')
}

kine commented

Yup, could be, but because long time ago I migrated from ps1 script for settings to json with the settings (place of the json is searched dynamically or could be set through parameters - see https://dynamicsuser.net/nav/b/kine/posts/navertical-transition-from-settings-ps1-to-json ) I recommend to use this way to store the settings.