I would like to copy a file from one location to another, and replace the first line of text with a string. I almost have the script complete, but not quite there.. (see below)
# -- copy the ASCX file to the control templates
$fileName = "LandingUserControl.ascx"
$source = "D:\TfsProjects\LandingPage\" + $fileName
$dest = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES\LandingPage"
#copy-item $source $dest -Force
# -- Replace first line with assembly name
$destf = $dest + "\" + $fileName
$destfTemp = $destf + ".temp"
Get-Content $destf | select -skip 1 | "<text to add>" + $_) | Set-Content $destfTemp