Get-RepoList.ps1
Description
Pulls the repo list through the gh CLI, so private repos are included when your token can see them. Emits one row per repo: Name, Description, Visibility, Archived, Fork, Template, Empty, Language, Pushed, Stars, Url. Writes a table, objects on the pipeline, CSV, JSON, or a Markdown table. For an org's private repos the token also needs the read:org scope.
Syntax
.\Get-RepoList.ps1 [[-Owner] <String>] [[-Format] <String>] [[-OutFile] <String>] [[-Limit] <Int32>] [-ExcludeForks] [<CommonParameters>]
Parameters
| Parameter | Effect |
|---|---|
-Owner | GitHub user or org. Defaults to the account gh is logged in as. |
-Format | Table (default), Object, Csv, Json or Markdown. |
-OutFile | Write the output to a file instead of the console. A relative path goes in your projects folder; an absolute path is used as given. Table output is written as plain text, Object output as Clixml. |
-Limit | Max repos to fetch. Default 1000. |
-ExcludeForks | Leave forks out. They are listed by default. |
Examples
.\Get-RepoList.ps1 -Owner Real-Fruit-Snacks -Format Markdown -OutFile repos.md # Projects\repos.md
.\Get-RepoList.ps1 -Format Object | Where-Object Archived | Select-Object Name, Pushed
.\Get-RepoList.ps1 -Format Csv -OutFile repos.csv -ExcludeForks