Costa Rica
Last updated: 2026-01-20
List of References (Click to expand)
- Create a GitHub Personal Access Token (PAT):
-
Go to
GitHub → Settings → Developer settings → Personal access tokens. -
Create a Fine‑grained token with at least read‑only repo scope.
-
If your org enforces SSO, click Authorize for your org after creating the token.
-
Copy the token (it looks like ghp_xxxxx...).
-
Store the Token in PowerShell:
$env:GITHUB_TOKEN="ghp_yourtokenhere"
-
Call the GitHub API: Run PowerShell script that lists all repos in your org with their sizes. Please change
{YOUR-ORG-NAME}In GB
$headers = @{ Authorization = "token $env:GITHUB_TOKEN" } $response = Invoke-WebRequest -Uri "https://api.github.com/orgs/{YOUR-ORG-NAME}/repos?per_page=100" -Headers $headers $repos = $response.Content | ConvertFrom-Json # Show name and size in GB $repos | Select-Object name, @{Name="SizeGB";Expression={[math]::Round($_.size/(1024*1024),2)}} | Sort-Object SizeGB -Descending
E.g in GB:
In KB:
$headers = @{ Authorization = "token $env:GITHUB_TOKEN" } $response = Invoke-WebRequest -Uri "https://api.github.com/orgs/{YOUR-ORG-NAME}/repos?per_page=100" -Headers $headers $repos = $response.Content | ConvertFrom-Json # Show name and size in MB $repos | Select-Object name, @{Name="SizeMB";Expression={[math]::Round($_.size/1024,2)}} | Sort-Object SizeMB -Descending
E.g in KB: