powershell sharepoint 2010 update item 1

powershell sharepoint 2010 update item

$spWeb = Get-SPWeb -Identity http://yourdomain/sites/config
$spList = $spWeb.Lists["AppSettings"]
$spItem = $spList.GetItemById(10013) //or another way that you prefer.
$spItem["Name"] = "MyName"
$spItem.Update()

Here is what the above code is Doing:
1. Get the SPWeb object for the site where the list is located.
2. Get the SPList object for the list.
3. Get the SPListItem object for the item you want to update.
4. Set the value of the field you want to update.
5. Call the Update() method on the SPListItem object to save the changes.

Similar Posts