I'm trying to find resources to help me write a powershell script to add text to an existing aspx file but can't seem to find anything. Does anybody have any suggestions or is there anybody that can help me some other way?
Update: So it's out there, I'm using version 1.0.
I have:
$lines = Get-Content foo.aspx
$lines = "<head>asfdsfsafd</head>" + $lines
$lines | Out-File "c:\documents and settings\...\foo.aspx" -Encoding utf8
but it wipes out everything originally in foo.aspx and creates <head>asfdsfsafd</head><head>asfdsfsafd</head>. How do I fix it so it keeps the original stuff in foo and add stuff to the beginning of the file rather than end?
Update:
I've figured out how to add text with:
$lines = add-content -path "C:\Documents and Settings\..\foo.aspx" -value "Warning...."
but want the text to go at the beginning of the aspx file
Update: I found a function that does what I want and I'm all set.