From 0e6b8f832b1afcde08cb9520071f4a812466b796 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Tue, 20 Sep 2022 16:04:03 +0900 Subject: [PATCH] ssh-agent ps1 --- dotfiles/pwsh/powershell_profile.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dotfiles/pwsh/powershell_profile.ps1 b/dotfiles/pwsh/powershell_profile.ps1 index fb8f136..46fdc5d 100644 --- a/dotfiles/pwsh/powershell_profile.ps1 +++ b/dotfiles/pwsh/powershell_profile.ps1 @@ -27,8 +27,11 @@ $Editor = "C:\Users\Owner\AppData\Local\Programs\Microsoft VS Code\Code.exe" # oh my posh # oh-my-posh --init --shell pwsh --config ~/AppData/Local/Programs/oh-my-posh/themes/capr4n.omp.json | Invoke-Expression -# enable ssh-agent -#sudo Set-Service -Name ssh-agent -StartupType Manual | Start-Service ssh-agent +# shortcut to enable ssh-agent +function Enable-SshAgent { + sudo Set-Service -Name ssh-agent -StartupType Manual && Start-Service ssh-agent +} +# execute "ssh-add" to add keys # chezmoi completion $script = "$HOME\.config\powershell\chezmoi_completion.ps1" @@ -48,4 +51,4 @@ Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock { winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } -} \ No newline at end of file +}