In "more than one way to flatten a cat," you can do the same with Out-File, if that's your preference on Thursdays. Written for a better understanding of flow compared to single line condensation.
$x = Get-Content $source_file $x[0] = "stuff you want to put on first line" $x | Out-File $dest_file
This takes advantage of the fact that Get-Content creates an array, with each row being an element of this array.
source share