Insert item from source list
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.items
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["Title"]
$newitem= $listb.items.Add()
$newitem["Title"] = $item["Title"]
$newitem["MultiLine"] = $item["MultiLine"]
$newitem["Number"] = $item["Number"]
$newitem["HyperLink"] = $item["HyperLink"]
$newitem["Choice"] = $item["Choice"]
$newitem["Created"] = $item["Created"]
$newitem["Author"] = $item["Author"]
$newitem["Modified"] = $item["Modified"]
$newitem["Editor"] = $item["Editor"]
$newitem.update()
start-sleep 1
}
$web.dispose
start-sleep 10
Powershell sharepoint get item by id
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.GetItemById(523)
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["ID"]
write-host -foregroundcolor yellow $item["Title"]
start-sleep 1
}
$web.dispose
start-sleep 10
Update Item by ID
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.GetItemById(523)
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["Title"]
$newitem= $listb.GetItemById(524)
$newitem["Title"] = $item["Title"]
$newitem["MultiLine"] = $item["MultiLine"]
$newitem["Number"] = $item["Number"]
$newitem["HyperLink"] = $item["HyperLink"]
$newitem["Choice"] = $item["Choice"]
$newitem["Created"] = $item["Created"]
$newitem["Author"] = $item["Author"]
$newitem["Modified"] = $item["Modified"]
$newitem["Editor"] = $item["Editor"]
$newitem.update()
start-sleep 1
}
$web.dispose
start-sleep 10
Thanks.
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.items
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["Title"]
$newitem= $listb.items.Add()
$newitem["Title"] = $item["Title"]
$newitem["MultiLine"] = $item["MultiLine"]
$newitem["Number"] = $item["Number"]
$newitem["HyperLink"] = $item["HyperLink"]
$newitem["Choice"] = $item["Choice"]
$newitem["Created"] = $item["Created"]
$newitem["Author"] = $item["Author"]
$newitem["Modified"] = $item["Modified"]
$newitem["Editor"] = $item["Editor"]
$newitem.update()
start-sleep 1
}
$web.dispose
start-sleep 10
Powershell sharepoint get item by id
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.GetItemById(523)
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["ID"]
write-host -foregroundcolor yellow $item["Title"]
start-sleep 1
}
$web.dispose
start-sleep 10
Update Item by ID
$web = Get-SPWeb http://yourURL
$lista =$web.Lists["Source List Name"]
$listb =$web.Lists["Target List Name"]
$items = $lista.GetItemById(523)
foreach ($item in $items) {
write-host -foregroundcolor yellow $item["Title"]
$newitem= $listb.GetItemById(524)
$newitem["Title"] = $item["Title"]
$newitem["MultiLine"] = $item["MultiLine"]
$newitem["Number"] = $item["Number"]
$newitem["HyperLink"] = $item["HyperLink"]
$newitem["Choice"] = $item["Choice"]
$newitem["Created"] = $item["Created"]
$newitem["Author"] = $item["Author"]
$newitem["Modified"] = $item["Modified"]
$newitem["Editor"] = $item["Editor"]
$newitem.update()
start-sleep 1
}
$web.dispose
start-sleep 10
Thanks.