$i=0; Get-ChildItem -File | Sort-Object Name | ForEach-Object { if($i++ % 2 -eq 0) { Remove-Item $_.FullName -Force } }