This commit is contained in:
fuenmao
2026-10-29 14:26:48 +08:00
parent d69533d1c3
commit 851b807c1f
+13 -1
View File
@@ -2,11 +2,23 @@
[CmdletBinding()]
param(
[switch]$UpdateConfig,
[string]$ConfigPath = (Join-Path $PSScriptRoot 'appsettings.Development.json')
[string]$ConfigPath
)
$ErrorActionPreference = 'Stop'
if ([string]::IsNullOrWhiteSpace($ConfigPath)) {
$scriptDirectory = $PSScriptRoot
if ([string]::IsNullOrWhiteSpace($scriptDirectory) -and
-not [string]::IsNullOrWhiteSpace($MyInvocation.MyCommand.Path)) {
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
}
if ([string]::IsNullOrWhiteSpace($scriptDirectory)) {
throw 'Cannot determine the script directory. Specify -ConfigPath with the full config path.'
}
$ConfigPath = Join-Path $scriptDirectory 'appsettings.Development.json'
}
function ConvertTo-EncryptedValue {
param(
[Security.SecureString]$Value,