Advertisement
Guest User

Untitled

a guest
Dec 21st, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. ;Requires TortoiseGit: cinst tortoisegit
  2. ;If it doesn't work, run as administrator (for TortoiseGit automation)
  3. ;Add this to PowerShell profile
  4. ; $sshaskpass_path = 'C:\Program Files\TortoiseGit\bin\sshaskpass.exe'
  5. ; if (Test-Path $sshaskpass_path) { $ENV:GIT_ASKPASS = $sshaskpass_path } else { Write-Warning 'Git profile: sshaskpass not found' }
  6.  
  7.  
  8. #SingleInstance, force
  9.  
  10. user := "<YOUR USERNAME HERE>"
  11. pass := "<YOUR PASS HERE>"
  12.  
  13. SetKeyDelay, 0
  14. wait:
  15. WinWait, ahk_exe sshaskpass.exe
  16. WinGetText, win_text
  17.  
  18. if InStr(win_text, "Username for")
  19. ControlSend, Edit1, %user%{ENTER}, ahk_exe sshaskpass.exe
  20.  
  21. if InStr(win_text, "Password for")
  22. ControlSend, Edit1, %pass%{ENTER}, ahk_exe sshaskpass.exe
  23.  
  24. Goto, wait
  25. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement