rename scripts and fix collections location

This commit is contained in:
2026-07-22 12:20:35 +02:00
parent 1fd36fd957
commit 5ae3b93436
6 changed files with 26 additions and 15 deletions
+8 -4
View File
@@ -25,8 +25,12 @@ function Ask-YesNo($message) {
}
# Funzione per chiedere un valore
function Ask-Value($key) {
return Read-Host "Valore per '$key' (digita `"`" per inserire stringa vuota e lascia vuoto per NON aggiornare)"
function Ask-Value($key, $currentValue) {
$currentValueHint = ""
if (-not [string]::IsNullOrEmpty($currentValue)) {
$currentValueHint = "[attuale: '$currentValue'] "
}
return Read-Host "Chiave '$key' $currentValueHint`n(digita `"`" per inserire stringa vuota e lascia vuoto per NON aggiornare)"
}
# Copia profonda preservando ordine
@@ -79,8 +83,6 @@ foreach ($topKey in $parsedJson.Keys) {
continue
}
$inputValue = Ask-Value $key
if ($existingEnv -and $existingEnv["API"] -and $existingEnv["API"].Contains($sectionName)) {
$oldValue = $existingEnv["API"][$sectionName][$key]
}
@@ -88,6 +90,8 @@ foreach ($topKey in $parsedJson.Keys) {
$oldValue = ""
}
$inputValue = Ask-Value $key $oldValue
if ($inputValue -eq "") {
# Mantieni valore esistente se presente
$newSection[$key] = $oldValue