ĐÀO TẠO DOANH NGHIỆP : SỞ KHOA HỌC CÔNG NGHỆ TỈNH ĐỒNG NAI

ENTERPRISE TRAINING: DONG NAI DEPARTMENT OF SCIENCE AND TECHNOLOGY.

123

Thursday, October 22, 2015

PowerShell copy list item to another list with same structure

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"]...