Skip to content

Commit

Permalink
Fix multiple Pageant keys handling
Browse files Browse the repository at this point in the history
Handling multiple pageant keys and keys with spaces in didn't work
properly, now fixed and functioning in a more powershell-y way.
  • Loading branch information
theaquamarine committed Feb 14, 2016
1 parent f71b636 commit f504692
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,8 @@ function Add-SshKey() {
if ($args.Count -eq 0) {
$keystring = ""
$keyPath = Join-Path $Env:HOME ".ssh"
$keys = Get-ChildItem $keyPath/"*.ppk" | Select -ExpandProperty Name
foreach ( $key in $keys ) { $keystring += "`"$keyPath\$key`" " }
if ( $keystring ) { & $pageant "$keystring" }
$keys = Get-ChildItem $keyPath/"*.ppk" -ErrorAction SilentlyContinue | Select -ExpandProperty FullName
& $pageant $keys
} else {
foreach ($value in $args) {
& $pageant $value
Expand Down

0 comments on commit f504692

Please # to comment.