1 2 3 4 5 6 7 8 9 10 11 12 13
$content = Get-Content .\test.txt; $i = 0; $new = @(); foreach($zeile in $content) { if($i%2 -eq 0) { $new+= $zeile } $i++ } Set-Content -Path .\new.txt -Value $new
You can clone a snippet to your computer for local editing. Learn more.