In powershell, how to let git ask for ssh key passphrase?

To let git prompt ssh key passphrase in powershell, The environment variable GIT_SSH has to be set to C:\Windows\System32\OpenSSH\ssh.exe. After setting up this environment variable, powershell has to be restarted to use it.

You can either add the environment variable in Control Panel, or execute the following commands in powershell:

$SSHPath = (Get-Command -Name 'ssh.exe').Source
[Environment]::SetEnvironmentVariable('GIT_SSH', $SSHPath, 'User')

To verify you have successfully setup this environment variable, do the following in powershell:

> echo $env:git_ssh
C:\Windows\System32\OpenSSH\ssh.exe