File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # Prerequisites - you need to get SSH key supported by your git hosting service.
2+ # deploy it into: c:\id_rsa
3+
4+ # install choco
5+ Set-ExecutionPolicy Bypass - Scope Process - Force; [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.ServicePointManager ]::SecurityProtocol -bor 3072 ; iex ((New-Object System.Net.WebClient).DownloadString(' https://community.chocolatey.org/install.ps1' ))
6+
7+ # install dependencies
8+ choco install git - y
9+
10+ # deploy SSH key into keys store
11+ $userName = [Environment ]::UserName
12+ Write-Host " Username: $userName " - ForegroundColor Green
13+ Get-Item c:\id_rsa | Copy-Item - Destination " C:\Users\$userName \.ssh\id_rsa"
14+
15+ # enable ssh service
16+ Get-Service - Name ssh- agent | Set-Service - StartupType Manual
17+ Start-Service ssh- agent
18+
19+ # register ssh key
20+ ssh- add " C:\Users\$userName \.ssh\id_rsa"
21+
22+ # register known_hosts
23+ ssh- keyscan bitbucket.org >> " C:\Users\$userName \.ssh\known_hosts"
24+ ssh- keyscan github.com >> " C:\Users\$userName \.ssh\known_hosts"
25+ ssh- keyscan vs-ssh.visualstudio.com >> " C:\Users\$userName \.ssh\known_hosts"
26+
27+ # test connection to git repositories
28+ ssh - T ssh:// alan- null@vs -ssh.visualstudio.com
29+ ssh - T git@bitbucket.org
30+ ssh - T git@github.com
You can’t perform that action at this time.
0 commit comments