I came back to this question for nostalgic reasons. (It being my first PowerShell script and all)
This how I would do it now utilising the pipeline.
$log = "C:\status.txt"
(Get-Content $log) | foreach{$_.replace("site status: 0","site status: 1")} | Set-Content $log
Invoke-Item $log
The thing about PowerShell that really trumps vbscript is that you can knock out a simple script like this from the top of your head and not have to refer to your little code repository of snipits to read write files etc. Also what I have written there is long hand. This is truly a one liner...
(GC "C:\status.txt") | %{$_.replace("site status: 0","site status: 1")} | SC "C:\status.txt"
Notice how the get-content bit is in brackets? That is so the process of reading the file is complete before moving on. Now we can save to the same file we are reading from. Also notice how you can bash it out using alias names.
<message edited by TomRiddle on Friday, April 22, 2011 5:29 PM>