Created
December 22, 2020 22:11
-
-
Save sumanssaurabh/23cc3c937aaf5b0036a829ed86bfba55 to your computer and use it in GitHub Desktop.
clone all public repos from github using powershell and git cli
This file contains 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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true, ParameterSetName = "name")] | |
[string] | |
$name | |
) | |
$api_url = "https://api.github.com/users/$($name)/repos?per_page=200" | |
$repos = Invoke-WebRequest -UseBasicParsing -Uri $api_url | ConvertFrom-Json | |
$repos = getRepos($name) | |
foreach ($repo in $repos) { | |
Write-Host "Cloning via SSH URL $($repo.ssh_url)" | |
git clone $repo.ssh_url | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment