Example
- First open the Command prompt and "Run as Administrator".
- Once the command prompt is open navigate to the PSTools directory.
- From the command prompt we need to run git-bash using PSExec or PSExec64 as the Local Service, which Jenkins is running on the build server as by default.
- We will use the -i switch to run PSExec as interactive and the -s switch to run git-bash as the local service
- Follow the instructions for creating a ssh key on GitHub - Generating a new SSH key and adding it to the ssh-agent
- If you are on a 64bit Windows system, then copy the .ssh folder to C:\Windows\SysWOW64\config\systemprofile.ssh (this was not needed on my 64bit Windows system, but there where some instructions that indicated the .ssh files should be stored there, something to keep in mind if you are having problems still).
- Add the public SSH key to your github keys.
Your Commandline should look similar to this:
C:\Programs\PSTools> PSExec.exe -i -s C:\Programs\Git\git-bash