Skip to content

Instantly share code, notes, and snippets.

@sumanssaurabh
Created December 22, 2020 22:11
Show Gist options
  • Save sumanssaurabh/23cc3c937aaf5b0036a829ed86bfba55 to your computer and use it in GitHub Desktop.
Save sumanssaurabh/23cc3c937aaf5b0036a829ed86bfba55 to your computer and use it in GitHub Desktop.
clone all public repos from github using powershell and git cli
[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