Below is a script that will change the value of URL field from something to something. Script works fine and is safe to run. Now, I would like to output in a txt file the old and new values.. Please help with this.
$webs = Get-SPSite http://<somesitecollection> | get-spweb -limit all | ?{$_.URL -like ‘<somethinghere’}
Â
foreach ($web in $webs)
{
               $list = $web.Lists[“<someList>”]
               foreach ($item in $list.Items)
                               {
                      # Iterate HyperLink fields
                      foreach ($field in $fields)
                                               {
                                             # Get field value
                                             $fldValue = $item[“URL”]
                                             # Skip if null
                                             if($fldValue -ne $null)
                                                                               {
                                                              $item[“URL”] = $fldValue -replace “<something>”, “<withSomething>”
                                                              $item.update()
                                      }
                       }
               }
Â
}
$webs.Dispose()
Looks good. Now other people can use it when they need it as well 🙂