Created
June 12, 2018 13:02
-
-
Save markembling/8c201b45085f30d61d9f286d4ef68782 to your computer and use it in GitHub Desktop.
Allow SSH agent installed and managed by posh-git to also be usable from other non-PowerShell processes (e.g. Tower Git client for Windows).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this into your profile AFTER posh-git has been loaded and the SSH agent | |
# has been started. | |
[void][Environment]::SetEnvironmentVariable("SSH_AGENT_PID", [Environment]::GetEnvironmentVariable("SSH_AGENT_PID"), [EnvironmentVariableTarget]::User) | |
[void][Environment]::SetEnvironmentVariable("SSH_AUTH_SOCK", [Environment]::GetEnvironmentVariable("SSH_AUTH_SOCK"), [EnvironmentVariableTarget]::User) | |
# It may make it a little slower (as apparently writing to the user environment | |
# is slow), but will mean the SSH agent is visible to other processes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment