https://github.com/jeromewolff/github-organization-repo-bulk-delete
PowerShell Script to bulk delete multiple repositories in a organization via Fine-grained Personal Access Token
https://github.com/jeromewolff/github-organization-repo-bulk-delete
github-token powershell powershell-script powershell7
Last synced: 6 months ago
JSON representation
PowerShell Script to bulk delete multiple repositories in a organization via Fine-grained Personal Access Token
- Host: GitHub
- URL: https://github.com/jeromewolff/github-organization-repo-bulk-delete
- Owner: JeromeWolff
- Created: 2025-01-06T15:46:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T15:56:02.000Z (about 1 year ago)
- Last Synced: 2025-03-01T07:29:59.573Z (12 months ago)
- Topics: github-token, powershell, powershell-script, powershell7
- Language: PowerShell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Repository Deletion Tool
A PowerShell script to delete multiple GitHub repositories within an organization based on a specific prefix. This tool utilizes a fine-grained personal access token (PAT) for authentication and interacts with the GitHub REST API.
## Features
- Deletes repositories with a specified prefix.
- Works for repositories within an organization.
- Supports GitHub's fine-grained access token for secure and scoped authentication.
- Handles paginated results for organizations with many repositories.
## Prerequisites
1. **GitHub Token**: A fine-grained personal access token with the `delete_repo` permission scoped to the target organization.
2. **PowerShell**: PowerShell 7 or higher is recommended.
## Usage
### 1. Clone or Download the Script
Save the script as `Delete-GitHubRepos.ps1`.
### 2. Run the Script
Execute the script in PowerShell with the following parameters:
```powershell
.\Delete-GitHubRepos.ps1 -GitHubToken "" -OrganizationName "" -RepoPrefix ""
```