Modify list items with Powershell

When you have a list with a lot of items it can be hard when you have to update the items. You can use Powershell to do this. The following snippet shows you how you can do this:

$SPAssignment = Start-SPAssignment
$SPWeb = Get-SPWeb "
https://servername/site" -AssignmentCollection $spAssignment
$SPList = $SPWeb.Lists["verlof"]
$spQuery = new-object Microsoft.SharePoint.SPQuery
$camlQuery = "<Where><Eq><FieldRef Name=’Title’ /><Value Type=’Text’>migration</Value></Eq></Where>"
$spQuery.Query = $camlQuery
$spListItemCollection = $spList.GetItems($spQuery)
foreach ($ListItem in $SPListItemCollection)
$ListItem["Title"] = "newtitle from " + $ListItem["Author"].ToString().Split(‘#’)[1]

Stop-SPAssignment $SPAssignment