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