cloudflare / cloudflare/cloudflare-docs

Add Windows PowerShell alternative for "delete project with too many deployments" guide

Open Beginner friendly
#31,753 1 comment 0 reactions 0 assignees View on GitHub
content:edit documentation product:pages stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Existing documentation URL(s)

The current documentation for deleting a project with too many deployments relies on a shell script workflow that works for Linux/macOS shells, but is not Windows-friendly as written. It also throws a "jq not found" error in WSL for me.

### What changes are you suggesting?

Please add examples in tabs to the guide:

- Shell script (Linux/macOS)
- PowerShell `.ps1` (Windows)

```ps1
$prod_id = ""
while ($true) {
$json = npx wrangler pages deployment list --project-name --json 2>$null
$ids = ($json | ConvertFrom-Json) | Select-Object -ExpandProperty id
$to_delete = $ids | Where-Object { $_ -ne $prod_id }
if (-not $to_delete) {
Write-Host "Done. Production: $prod_id"
break
}
Write-Host "Deleting $(@($to_delete).Count) deployments..."
foreach ($id in $to_delete) {
$output = npx wrangler pages deployment delete $id --project-name --force 2>&1
if ($output -notmatch "Successfully deleted") {
if ($output -match "active production deployment") {
$prod_id = $id
}
}
}
}
```

This would make the guide much more accessible for Windows users.

### Additional information

I _could_ make a PR, but I don't think I've got the time anytime soon. Maybe someone else is faster than me. If not, I will do it.

Contributor guide

Open the contributing guide

Research direction

Locate the existing guide for deleting a project with too many deployments and read its current shell-script workflow. Add tabs for the existing Linux/macOS shell example and the proposed Windows PowerShell .ps1 example, including the deployment-listing and deletion commands. Done means Windows users have a documented alternative alongside the existing workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.