Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 通过在Powershell中调用的VB程序集屏蔽用户输入_Vb.net_Powershell - Fatal编程技术网

Vb.net 通过在Powershell中调用的VB程序集屏蔽用户输入

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脚本,希望用户输入密码。它调用一个函数来获取用户输入的弹出框。现在它是纯文本的。我想把它藏起来/遮住

这是创建的函数:---

这是我从powershell调用函数的方式:---


如何将密码屏蔽为****

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