我想创建一个可以创建本地用户的Powershell Gui脚本。这里的问题是,为什么代码要求参数?使用-nopassword它的作品。Powershell添加本地用户
代码:
$button_BenutzerErstellen_OnClick=
{
$textBox6.Text
$textBox7 = ConvertTo-SecureString -AsPlainText -Force
if (($handler_textBox6.Text -eq 0) -or
($handler_textBox7.TextLength -eq 0)) {
[System.Windows.Forms.MessageBox]::Show("Bitte füllen Sie alle Kriterien aus." , "Combat 19")
}else{
New-LocalUser $textBox6.Text -Password $textBox7 -Description $textBox1.Text
}
谢谢,但为什么代码问我一个字符串? -nopassword工作,但与密码它问我的字符串。 –