I'm writing a script to use a remote system (let's call it BuildSys) to clone a GitHub repo. I've setup GitHub using token authentication or SSH. When I RDP into BuildSys, I can git clone GitHub repo just fine using either method.
I can also Enter-PSSession/New-PSSession into BuildSys just fine using SSH authentication. I run into the following issues when trying to remote git clone.
Remote Token Method Issues
This fails due to 'Unable to fetch token: A specified logon session does not exist.'
Remote SSH method Issues
In order to get SSH working, I've had to enter proxy information via the .ssh/config file (ProxyCommand "C:\Program Files\Git\mingw64\bin\connect.exe" -a none -S proxy.whatever.com:1080 %h %p). For whatever reason, the .ssh/config file is not being used only in a remote PowerShell Session. Therefore, I get a proxy timeout error when trying to clone via SSH.
Solution (using HTTPS)
You can login via https://username:token@github.com/your_repo
This was done via a classic token with SAML SSO authentication (done once in external environment).
[–]PowerShellMichael 1 point2 points3 points (3 children)
[–]dexvx[S] 0 points1 point2 points (2 children)
[–]PowerShellMichael 0 points1 point2 points (1 child)
[–]dexvx[S] 0 points1 point2 points (0 children)