Looking for script to create a xml file

Welcome Forums General PowerShell Q&A Looking for script to create a xml file

Viewing 1 reply thread
  • Author
    • #238757
      Topics: 7
      Replies: 9
      Points: 53
      Rank: Member


      I need a script which I can add,Delete, Search, Edit data in the xml file.

      Within xml file I would like to have 3 element and then with in each element would like to have unlimited keys with data.

      For eaxample.

      <Office 365>HR</Office365>
      <Office 2010>IT, Collector</Office2010>

      <Adobe>Reader, Player</Adobe>

      <p1>Work after 1pm, Work from home</p1>
      <p10>Work after 1pm, Work from desk</p10>


    • #239309
      Topics: 0
      Replies: 10
      Points: 108
      Rank: Participant

      Run the command Get-Command *XML* and there are several that are of interest especially ConvertTo-XML. You can also use the type accelerator below to read in an XML file:

      $xml = [xml] (get-content xmlfile.xml)

      Good luck.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.