111
This commit is contained in:
+13
-1
@@ -2,11 +2,23 @@
|
|||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param(
|
param(
|
||||||
[switch]$UpdateConfig,
|
[switch]$UpdateConfig,
|
||||||
[string]$ConfigPath = (Join-Path $PSScriptRoot 'appsettings.Development.json')
|
[string]$ConfigPath
|
||||||
)
|
)
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$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 {
|
function ConvertTo-EncryptedValue {
|
||||||
param(
|
param(
|
||||||
[Security.SecureString]$Value,
|
[Security.SecureString]$Value,
|
||||||
|
|||||||
Reference in New Issue
Block a user