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
    Posts
    • #238757
      Participant
      Topics: 7
      Replies: 9
      Points: 53
      Rank: Member

      Hi,

      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.

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

      -<License>
      <E3>E3</E3>
      <Adobe>Reader, Player</Adobe>
      </License>

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

       

    • #239309
      Participant
      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.