Add item to SharePoint 2016 list using PowerShell

Add item to SharePoint 2016 list using PowerShell

In this post, we will discuss how we can add an item to a SharePoint 2016 list using PowerShell. For this example, I have created a simple custom list which has fields like:
– Title (Single line of text)
– Email ID (Single line of text)
– Contact Number (Single line of text)
– Courses (Choice Column)
– UserComments (Multiline text)

And the list looks like below:

Add item to SharePoint 2016 list using PowerShell
Add item to SharePoint 2016 list using PowerShell

Also, you can read:
Deploy Administration approved InfoPath forms in SharePoint 2013

Open SharePoint 2013 list form in a dialog box on button click using JavaScript

Create user profile synchronization connection in SharePoint 2013

Below is the PowerShell command.

Here make sure you can use the internal column names while adding items to the list. You can follow below articles to get internal column names of a list.
– Get SharePoint List Field Internal Name in SharePoint 2013

– Get the internal name of a list field in SharePoint 2013

– Get internal names using client object model in SharePoint 2013

Just put the below code in PowerShell ISE and run the command.

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue

$webURL = “http://mypc:29024/sites/SPTraining/”

$listName = “MyTrainingListFromDesigner”

$web = Get-SPWeb $webURL

$list = $web.Lists[$listName]

$newItem = $list.Items.Add()

$newItem[“Title”] = “Bijay”

$newItem[“Email_x0020_ID”] = “xxxxxccccdddfffwersfghj@gmail.com”

$newItem[“Contact_x0020_Number”] = “123455666”

$newItem[“Courses”] = $newItem.Fields[“Courses”].GetFieldValue(“SharePoint Developer”);

$newItem[“UserComments”] = “I am interested for sharepoint training. please contact me.”

$newItem.Update()


Once you execute the PowerShell command, the item will be added to the list.

Hope this will be helpful.


You May Also like the Following SharePoint Online Tutorials:

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 →