Skip to content

Commit

Permalink
Handle multiple pageant processes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamTheCoder committed Aug 26, 2015
1 parent 77a18c2 commit 99021d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function Set-TempEnv($key, $value) {
# is a running agent.
function Get-SshAgent() {
if ($env:GIT_SSH -imatch 'plink') {
$pageantPid = Get-Process | Where-Object { $_.Name -eq 'pageant' } | Select -ExpandProperty Id
$pageantPid = Get-Process | Where-Object { $_.Name -eq 'pageant' } | Select -ExpandProperty Id -First 1
if ($null -ne $pageantPid) { return $pageantPid }
} else {
$agentPid = $Env:SSH_AGENT_PID
Expand Down

0 comments on commit 99021d4

Please sign in to comment.