Snippets

Ettar Powershell Zweite Zeile löschen

Created by Ettar
$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

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.