Hi all
I am trying to get html file from SharePoint, do some changes to a string, and
then move it back into SharePoint. Everything works ok until I upload the file
back to SharePoint.
This is what I have so far. The error I get is some random numbers to the
console and nothing in the library.
$fromfile = 'Server/site/library/filename.htm'
$tofile = 'c:\temp\ filename .htm'
$temp = 'c:\temp\ filename2.htm'
$weblient = New-Object System.Net.WebClient
$weblient.UseDefaultCredentials = $true
$weblient.DownloadFile($fromfile, $tofile)
Get-Content $tofile | ForEach-Object{$_ -replace "String1", "String2"} |
Set-Content $temp
$weblient.UploadFile($fromfile, $temp)
Eventually I would delete $tofile, and rename $temp and upload that.
Cheers
Marko
_______________________________________________
Sponsored by Infotext - Amazing Search for Microsoft SharePoint -
http://www.infotext.com/
ozmoss mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss