Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue
$csv = Import-Csv 'E:\Sharepoint\SharepointStuff\PowershellScripts\test\w\Import.csv'
$web = Get-SPWeb -identity "http://globas"
$list = $web.Lists["News"]
foreach ($row in $csv) {
$item = $list.Items.Add();
$item["Title"] =$row.Title
$item["Body"] =$row.Body
$item["Expires"] =$row.Expires
$item.Update()
}
Write-Host "Finished! Press enter key to exit." -ForegroundColor Green
Read-Host
please use CSV column as Title,Body
No comments:
Post a Comment