PnP provisioning is a community-driven platform that enables fast development of components that define your application infrastructure & the content to some extent. We use CSOM and can work against both SharePoint Online and SharePoint On-Premises. Let’s see how to do the Create list Item using PNP.
Prerequisite
Connect to Site
Connect to SharePoint site using Connect-PnPOnline cmdlet. The required parameters are,
-Url - The SharePoint site url (Eg: https://hubflysoft.sharepoint.com/sites/Hubfly)
The following code snippet helps to connect SharePoint sites.
The list item can be created by “Add-PnPListItem” cmdlet in a SharePoint site.
The required parameters are,
-List - The ID, Title, or Url of the list.
-Values - Use the internal names of the fields when specifying field names.
Single line of text: -Values @{"Title" = "Title New"}
The following code snippet helps to create SharePoint List item