PowerShell Script – To Export data from XML file to SharePoint list


Requirement:
Export Data from XML file to SharePoint list – using PowerShell script


Steps:
1.    Open the Script.ps1 file in notepad and edit it.
2.    Change the location of the XML file (Data.Xml) in the #set up connection area.
3.    Change the Site URL in the #set up connection area.
4.    Change the web in the #set up connection area.
5.    Change the list name in the #set up list connections area.
6.    Go to Power shell command prompt and type the command à Path of the script.ps1 file à e.g. C:\script.ps1
7.    The functionality will be achieved.
Also attached here is the list template (.stp) for the required list (ProjectDetails.stp).


You can upload the template on your SharePoint site to create the list and then update the script.ps1 file accordingly so as to achieve the requirement.


*If the list field names are changed, then script.ps1 will be modified accordingly.


Cheers!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s