Last active
July 28, 2022 12:18
-
-
Save PartTimeLegend/f3012ec59657543e11356ba4f989f26c to your computer and use it in GitHub Desktop.
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
$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