I'm using transform manager to auto-generate some HTML files for us and we need to change one line in each of those files. The code I'm using to change one of them is:
get-childitem default.html |
Get-Content |
ForEach-Object {$_ -replace "<AutoPlay>false</AutoPlay>", "<AutoPlay>true</AutoPlay>"} |
Set-Content default.html
Fairly simple. But when I try to loop through all the default.html files (there's one in each subdirectory):
$Files = Get-ChildItem -Path C:\inetpub\wwwroot -Name default.html -Recurse
foreach ($File in $Files) {
write-host "Updating $($File.fullname)..."
sleep 5
(Get-Content $file.fullname) |
ForEach-Object {$_ -replace "<AutoPlay>false</AutoPlay>", "<AutoPlay>true</AutoPlay>"} |
Set-Content $file.fullname
}
I seem to getting something strange back from the Get-ChildItem. The response is "Updating ...". Then it complains about the filename property. You guys see anything wrong here?
Thanks.


