How to Add,Update,Delete List items using powershell sharepoint 2010

A simple example of a powershell script to add items in a SharePoint 2010

$spAssignment = Start-SPAssignment
$mylist = (Get-SPWeb
-identity http://SP -AssignmentCollection
$newItem = $mylist
$newItem["Title"] = "Added by
$newItem["description"] = "My PowerShell
Stop-SPAssignment $spAssignment

list item example I -

$SPAssignment = Start-SPAssignment
$SPWeb =
Get-SPWeb http://SP -AssignmentCollection $spAssignment

Next step is to
get the list:
$SPList = $SPWeb.Lists["Announcements"]

When we have
located the list we can retrieve the item. The quickest way is to use the
GetItemByID() method:
$SPItem = $SPList.GetItemById("1")

The example
above requires that you know the ID of the item. If you don't know the items ID
you can use the Where-Object cmdlet instead:

$SPItem = $SPList.Items |
Where { $_["Title"] -eq "New Announcement" }
When you've retrieved the item
you can modify the item information.

$SPItem["Title"] =
$SPItem["Body"] = "MyBody"

After modifying an item you have
to call the Update() method to set the changes.

you're done, use the Stop-SPAssignment cmdlet to dispose the SPWeb object.
Stop-SPAssignment $SPAssignment

Delete Item -

The example below
will count the items and loop down, read the name of the item, and if the item
contains a 3, then it will delete that


$site = new-object Microsoft.SharePoint.SPSite("") #
is a legit url
$relweburl = '/Docs"
$web =
$list=$web.Lists["testList"] $listItems =
$listItemsTotal = $listItems.Count

($x=$listItemsTotal-1;$x -ge 0; $x--)

Write-Host("DELETED: " +