Vb.net 通过在Powershell中调用的VB程序集屏蔽用户输入
我有一个powershell脚本,希望用户输入密码。它调用一个函数来获取用户输入的弹出框。现在它是纯文本的。我想把它藏起来/遮住 这是创建的函数:--- 这是我从powershell调用函数的方式:---Vb.net 通过在Powershell中调用的VB程序集屏蔽用户输入,vb.net,powershell,Vb.net,Powershell,我有一个powershell脚本,希望用户输入密码。它调用一个函数来获取用户输入的弹出框。现在它是纯文本的。我想把它藏起来/遮住 这是创建的函数:--- 这是我从powershell调用函数的方式:--- 如何将密码屏蔽为**** Powershell没有输入框,而是有自己的实现Get Credential。它将凭证存储为安全字符串,因此获取明文密码需要一些调整。这样, $cred = Get-Credential -Message "Enter Sql password" $cred.GetN
如何将密码屏蔽为**** Powershell没有输入框,而是有自己的实现
Get Credential
。它将凭证存储为安全字符串,因此获取明文密码需要一些调整。这样,
$cred = Get-Credential -Message "Enter Sql password"
$cred.GetNetworkCredential().username # Show the username
$cred.GetNetworkCredential().password # Show the password
无法使用输入框进行此操作的可能重复:
$SQLPassword = Read-InputBoxDialog -Message "Please enter SQL password used to connect to Database Server" -WindowTitle "Sql Server Authentication" -DefaultText ""
$cred = Get-Credential -Message "Enter Sql password"
$cred.GetNetworkCredential().username # Show the username
$cred.GetNetworkCredential().password # Show the password