Skip to content

Instantly share code, notes, and snippets.

@PartTimeLegend
Last active July 28, 2022 12:18
Show Gist options
  • Save PartTimeLegend/f3012ec59657543e11356ba4f989f26c to your computer and use it in GitHub Desktop.
Save PartTimeLegend/f3012ec59657543e11356ba4f989f26c to your computer and use it in GitHub Desktop.
$orgs = @("whereyouwork")
$users = @("parttimelegend")
$githubToken = $ENV:GitHubToken
$workspace = "C:\workspace"
$timeout = 3600
function Clone-Repos-For-Org()
{
param(
[Parameter(Mandatory=$true)][string]$org
)
github-archive -o $org --clone -t $githubToken -ht -l $workspace --timeout $timeout
}
function Pull-Repos-For-Org()
{
param(
[Parameter(Mandatory=$true)][string]$org
)
github-archive -o $org --pull -t $githubToken -ht -l $workspace --timeout $timeout
}
function Clone-Repos-For-User()
{
param(
[Parameter(Mandatory=$true)][string]$user
)
github-archive -u $user --clone -t $githubToken -ht -l $workspace --timeout $timeout
}
function Pull-Repos-For-User()
{
param(
[Parameter(Mandatory=$true)][string]$user
)
github-archive -u $user --pull -t $githubToken -ht -l $workspace --timeout $timeout
}
foreach($org in $orgs)
{
Clone-Repos-For-Org $org
Pull-Repos-For-Org $org
}
foreach($user in $users)
{
Clone-Repos-For-User $user
Pull-Repos-For-User $user
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment