fix password entry

This commit is contained in:
paradizelost 2018-03-29 17:05:05 -05:00
parent e0bb9b9ad1
commit e7b016871d

View File

@ -51,11 +51,20 @@ function Global:connect-server(){
[void][WinAP]::SetForegroundWindow($process.MainWindowHandle) [void][WinAP]::SetForegroundWindow($process.MainWindowHandle)
[void][Winap]::ShowWindow($process.MainWindowHandle, 5) [void][Winap]::ShowWindow($process.MainWindowHandle, 5)
[void][Winap]::ShowWindow($process.MainWindowHandle, 5) [void][Winap]::ShowWindow($process.MainWindowHandle, 5)
start-sleep 2 start-sleep 3
#write-output $cred.getnetworkcredential().password #write-output $cred.getnetworkcredential().password
[System.Windows.Forms.SendKeys]::SendWait("$($cred.username){TAB}") foreach ($char in ("$($cred.username)").ToCharArray()) {
start-sleep .5 [System.Windows.Forms.SendKeys]::SendWait($char)
[System.Windows.Forms.SendKeys]::SendWait("$($cred.getnetworkcredential().password){enter}") start-sleep -Milliseconds 30
}
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
start-sleep -Milliseconds 30
foreach ($char in ("$($cred.getnetworkcredential().password)").ToCharArray()) {
[System.Windows.Forms.SendKeys]::SendWait($char)
start-sleep -Milliseconds 30
}
start-sleep 1
#[System.Windows.Forms.SendKeys]::SendWait("{enter}")
} }
function Show-Form() { function Show-Form() {
Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Windows.Forms