Pages

Search This Blog

Wednesday, November 30, 2011

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 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!

5 comments:

  1. Nice article and blog. Thank you. The links are not working anymore.
    Regards
    J.

    ReplyDelete
  2. I just downloaded all the files and every link is working. Please let us know what issue you are facing please?

    ReplyDelete
  3. Hi Nitin,
    i get Fehler 103 (net::ERR_CONNECTION_ABORTED): Unbekannter Fehler.
    File not reachable or moved. http://d3.minus.com/1363963963/_SzPqPHHTQaGKUAtqBrg6g/dsC22vnzhw2hm/Script.ps1
    thanx for your help

    ReplyDelete
  4. Looks like Minus is not allowing you to download files from your location as We are able to download it from here. I can send you all the external files in a zip achieve. Let me know your email address.

    ReplyDelete
    Replies
    1. Hi Nitin,

      mailed you my email adress.

      thanx for your help
      j.

      Delete