src/Pageant.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# Attempt to guess Pageant's location
function Find-Pageant() {
  Write-Verbose "Pageant not in path. Trying to guess location."

  $gitSsh = $env:GIT_SSH
  if ($gitSsh -and (test-path $gitSsh)) {
      $pageant = join-path (split-path $gitSsh) pageant
  }

  if (!(get-command $pageant -Erroraction SilentlyContinue)) {
      return # Guessing failed.
  }
  else {
      return $pageant
  }
}