| 1 | $i=0; Get-ChildItem -File | Sort-Object Name | ForEach-Object { if($i++ % 2 -eq 0) { Remove-Item $_.FullName -Force } } |
csmith1865 / Delete every other file
Last active 1 month ago
Last active 1 month ago
| 1 | $i=0; Get-ChildItem -File | Sort-Object Name | ForEach-Object { if($i++ % 2 -eq 0) { Remove-Item $_.FullName -Force } } |