You can get the content (array of strings) of the ASPX file using Get-Content
:
$lines = Get-Content foo.aspx
Or you can get the content as a single string which is sometimes more useful if you want to use a regex that spans lines:
$content = Get-Content foo.aspx -raw
As far as changing the content, you have all sorts of options:
$content = "text before " + $content
$content += "text after"
$content = $content -replace 'regex pattern','replacement text'
And then to write back out to the file:
$content | Out-File foo.aspx -Encoding <UTF8 or ASCII or UNICODE>