Most efficient way to delete first N lines from a log file

powershell, powershell-3.0

Solution

You could try the `Skip` parameter of `Select-Object`

Get-Content logfile.log | Select-Object -Skip 10 | Out-File clearedLogfile.txt

Problem

I have logs enabled for a lot of basic scripts I am running and I need to clear out those logs from time to time. What is the most efficient way to delete first N lines from a log file in PowerShell?

Original source