Fix secure password prompt binding in deploy script
This commit is contained in:
@@ -50,15 +50,15 @@ Assert-Tool $WinScpPath
|
|||||||
function Read-PlainOrPrompt([string]$Value, [string]$Prompt, [switch]$Secure) {
|
function Read-PlainOrPrompt([string]$Value, [string]$Prompt, [switch]$Secure) {
|
||||||
if ($Value) { return $Value }
|
if ($Value) { return $Value }
|
||||||
if ($Secure) {
|
if ($Secure) {
|
||||||
$secure = Read-Host -AsSecureString $Prompt
|
$secure = Read-Host -Prompt $Prompt -AsSecureString
|
||||||
return [Runtime.InteropServices.Marshal]::PtrToStringUni(
|
return [Runtime.InteropServices.Marshal]::PtrToStringUni(
|
||||||
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)
|
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return Read-Host $Prompt
|
return Read-Host -Prompt $Prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
$FtpPassword = Read-PlainOrPrompt $FtpPassword "FTP password"
|
$FtpPassword = Read-PlainOrPrompt $FtpPassword "FTP password" -Secure
|
||||||
$WinRmCredentialPass = Read-PlainOrPrompt $WinRmCredentialPass "WinRM password" -Secure
|
$WinRmCredentialPass = Read-PlainOrPrompt $WinRmCredentialPass "WinRM password" -Secure
|
||||||
|
|
||||||
Write-Host "1) Publishing..." -ForegroundColor Cyan
|
Write-Host "1) Publishing..." -ForegroundColor Cyan
|
||||||
|
|||||||
Reference in New Issue
Block a user