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) {
|
||||
if ($Value) { return $Value }
|
||||
if ($Secure) {
|
||||
$secure = Read-Host -AsSecureString $Prompt
|
||||
$secure = Read-Host -Prompt $Prompt -AsSecureString
|
||||
return [Runtime.InteropServices.Marshal]::PtrToStringUni(
|
||||
[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
|
||||
|
||||
Write-Host "1) Publishing..." -ForegroundColor Cyan
|
||||
|
||||
Reference in New Issue
Block a user