Add items to SharePoint list using PowerShell

This PowerShell SharePoint tutorial, explains how to add an item to a SharePoint list using PowerShell. The PowerShell code will work for SharePoint 2013 or SharePoint 2016 list.

The below PowerShell code will not work for SharePoint Online list. To insert an item to SharePoint Online list, you can check Insert/Add item to SharePoint Online list using PowerShell.

SharePoint deveopment training course

Add item to SharePoint List using PowerShell

Below is the PowerShell code, which will add or insert an item to SharePoint list using PowerShell.

$site = new-object Microsoft.SharePoint.SPSite(“http://site URL”)
$web = $site.rootweb
$list = $web.Lists[“ListName”]
$newitem = $list.items.Add()
$newitem[“Column Name1”]= “Column value”;
$newitem[“Column Name2”]= “Column value”;
$newitem.update()
$web.Dispose()
$site.Dispose()

You may like following PowerShell SharePoint tutorials:

Hope this SharePoint tutorial helps to insert item to SharePoint 2010/2013/2016/2019 list.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →