csmith1865

csmith1865 / Delete every other file

Last active 1 month ago

Like 0

csmith1865 revised this gist 1 year ago · 7f7d789

1 file changed, 1 insertion

Delete every other file.ps1 (file created)
@@ -0,0 +1 @@
1 + $i=0; Get-ChildItem -File | Sort-Object Name | ForEach-Object { if($i++ % 2 -eq 0) { Remove-Item $_.FullName -Force } }