{"id":17676549,"url":"https://github.com/trossr32/ps-github-repo-snapshot","last_synced_at":"2026-04-29T14:03:41.821Z","repository":{"id":115141417,"uuid":"358700841","full_name":"trossr32/ps-github-repo-snapshot","owner":"trossr32","description":"A Powershell module that integrates with the Github API and downloads a snapshot of all repositories for a user or organisation.","archived":false,"fork":false,"pushed_at":"2024-01-20T19:10:55.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T17:32:34.491Z","etag":null,"topics":["cmdlet","github-api","net-core-5","powershell","powershell-module"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/GithubRepoSnapshot","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trossr32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-16T19:32:18.000Z","updated_at":"2024-04-23T09:21:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a83a294-1887-4d37-83a4-b7822e2ab1bb","html_url":"https://github.com/trossr32/ps-github-repo-snapshot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trossr32/ps-github-repo-snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trossr32%2Fps-github-repo-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trossr32%2Fps-github-repo-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trossr32%2Fps-github-repo-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trossr32%2Fps-github-repo-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trossr32","download_url":"https://codeload.github.com/trossr32/ps-github-repo-snapshot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trossr32%2Fps-github-repo-snapshot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259325530,"owners_count":22841057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmdlet","github-api","net-core-5","powershell","powershell-module"],"created_at":"2024-10-24T07:25:59.343Z","updated_at":"2026-04-29T14:03:36.788Z","avatar_url":"https://github.com/trossr32.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PsGithubRepoSnapshot\n\n[![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/GithubRepoSnapshot?label=GithubRepoSnapshot\u0026logo=powershell\u0026style=plastic)](https://www.powershellgallery.com/packages/GithubRepoSnapshot)\n[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/GithubRepoSnapshot?style=plastic)](https://www.powershellgallery.com/packages/GithubRepoSnapshot)\n\nA Powershell module that integrates with the Github API and downloads a snapshot of all repositories for a user or organisation.\n\nAvailable in the [Powershell Gallery](https://www.powershellgallery.com/packages/GithubRepoSnapshot)\n\n## Requirements\n\nA Github personal access token needs to be created with permissions to access repositories: [Github personal access tokens](https://github.com/settings/tokens).\n\n## Description\n\n### Get-GithubRepos\n\nGet a list of repositories from the Github API for a user or organisation. Optionally filter the results.\n\nUses endpoints: \n\n[Github API docs (get repositories for user)](https://docs.github.com/en/rest/reference/repos#list-repositories-for-a-user).\n[Github API docs (get repositories for organisation)](https://docs.github.com/en/rest/reference/repos#list-organization-repositories).\n\n### New-GithubRepoSnapshot\n\nCreate a snapshot directory containing Github repositories. \n\nOptionally filter repositories by providing a filter type, filter search type and filter text parameters. \n\nOptionally specify which branch to retrieve (the Github repository default branch will be used otherwise).\n\nOptionally supply the ooutput path (C:/temp will beused otherwise).\n\n**Hint**: Use the Verbose flag to get an informational message written to the host for each repository downloaded.\n\n## Installation (from the Powershell Gallery)\n\n```powershell\nInstall-Module GithubRepoSnapshot\nImport-Module GithubRepoSnapshot\n```\n\n## Supplying API credentials\n\nBefore any of the GithubRepoSnapshot cmdlets can be run, both your host and credentials need to be registered to the current session using the Set-GithubRepoSnapshotCredentials cmdlet, for example:\n\n```powershell\nSet-GithubCredentials -AccountName 'user' -ApiKey 'api_key' -AccountType User\n```\n\nThis registers your credentials for the duration of the session. Adding a -StorePermanent switch to the Set-GithubRepoSnapshotCredentials command will create an encrypted file saved on your machine that will obviate the need to set credentials with each new session:\n\n```powershell\nSet-GithubCredentials -AccountName 'user' -ApiKey 'api_key' -AccountType User -StorePermanent\n```\n\nYou can remove credentials at any time by using the Remove-GithubRepoSnapshotCredentials cmdlet. To remove a file created using the -StorePermanent switch run the Remove-GithubRepoSnapshotCredentials with a -DeletePermanent switch:\n\n```powershell\nRemove-GithubCredentials -DeletePermanent\n```\n\n## Included cmdlets\n\n### Credentials\n\n```powershell\nSet-GithubCredentials\nRemove-GithubCredentials\n```\n\n### Get repositories\n\n```powershell\nGet-GithubRepos\n```\n\n### Create snapshot\n\n```powershell\nNew-GithubRepoSnapshot\n```\n\n## Building the module and importing locally\n\n### Build the .NET core solution\n\n```powershell\ndotnet build [Github clone/download directory]\\ps-github-repo-snapshot\\src\\PsGithubRepoSnapshot.sln\n```\n\n### Copy the built files to your Powershell modules directory\n\nRemove any existing installation in this directory, create a new module directory and copy all the built files.\n\n```powershell\nRemove-Item \"C:\\Users\\[User]\\Documents\\PowerShell\\Modules\\GithubRepoSnapshot\" -Recurse -Force -ErrorAction SilentlyContinue\nNew-Item -Path 'C:\\Users\\[User]\\Documents\\PowerShell\\Modules\\GithubRepoSnapshot' -ItemType Directory\nGet-ChildItem -Path \"[Github clone/download directory]\\ps-github-repo-snapshot\\src\\PsGithubRepoSnapshotCmdlet\\bin\\Debug\\netcoreapp3.1\\\" | Copy-Item -Destination \"C:\\Users\\[User]\\Documents\\PowerShell\\Modules\\GithubRepoSnapshot\" -Recurse\n```\n\n## Contribute\n\nPlease raise an issue if you find a bug or want to request a new feature, or create a pull request to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrossr32%2Fps-github-repo-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrossr32%2Fps-github-repo-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrossr32%2Fps-github-repo-snapshot/lists"}