$items = Get-Content 'D:\Softwares\phpstudy_pro\WWW\fenleixinxi\tmp_img\mcp_items.json' -Raw | ConvertFrom-Json $downloadedDir = 'D:\Softwares\phpstudy_pro\WWW\fenleixinxi\tmp_img\downloaded' $done = @() $pending = @() foreach ($item in $items) { $jpgPath = Join-Path $downloadedDir ($item.id + '.jpg') if (Test-Path $jpgPath) { $done += $item } else { $pending += $item } } Write-Host "Done: $($done.Count) / $($items.Count)" Write-Host "Pending: $($pending.Count)" Write-Host "" Write-Host "Pending IDs:" Write-Host ($pending.id -join ', ') # Save pending for reference $pending | ConvertTo-Json -Depth 3 | Set-Content 'D:\Softwares\phpstudy_pro\WWW\fenleixinxi\tmp_img\pending.json'