From 2657b96fad9cd6a5cd8680bac6726f20945a1410 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Thu, 29 Sep 2022 19:29:22 +0900 Subject: [PATCH] add: pwsh :Invoke-SshAdd --- dotfiles/pwsh/powershell_profile.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index d098d57..5f1253c 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -126,6 +126,19 @@ function Enable-SshAgent { #> sudo Set-Service -Name ssh-agent -StartupType Manual && Start-Service ssh-agent } +# auto start ssh-agent and do ssh-add +function Invoke-SshAdd { + <# + .SYNOPSIS + Starts ssh-agent and do ssh-add + + .DESCRIPTION + Starts ssh-agent as admin and do ssh-add, to add sshkeys to ssh-agent. + #> + + Enable-SshAgent + ssh-add +} # execute "ssh-add" to add keys