Вам необходимо перенаправить стандартный ввод (т. Е. STDIN), чтобы вы могли писать прямо в него из своего приложения:
Dim psi As New ProcessStartInfo("powershell", "-noexit runas /u:FL-LOCAL\UserName notepad.exe") With
{
.RedirectStandardInput = True,
.RedirectStandardOutput = False,
.UseShellExecute = False
}
Dim p As New Process With
{
.StartInfo = psi
}
p.Start()
p.StandardInput.WriteLine(password)