Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:46:45+00:00 2026-06-01T00:46:45+00:00

Currently, I’m building several arrays in Powershell, but to make the code more portable,

  • 0

Currently, I’m building several arrays in Powershell, but to make the code more portable, I’d like to use XML files as a simpler (read more foolproof) way of managing how each array serves its purpose.

Array 1 is a master list of information – containing a rownumber, Name, retention, and Type. I would like for the XML to look like this:

<?xml version="1.0" encoding="UTF-8"?>
<ZipList>
    <Backup RowID="1">
        <RowNbr>1</RowNbr>
        <NameType>TargetBackup</NameType>
        <Retention>10</Retention>
        <FileType>Folder</FileType>
    </Backup>
    <Backup RowID="2">
        <RowNbr>2</RowNbr>
        <NameType>SourceBackup</NameType>
        <Retention>7</Retention>
        <FileType>Folder</FileType>
    </Backup>
    <Backup RowID="3">
        <RowNbr>3</RowNbr>
        <NameType>XMLBackup</NameType>
        <Retention>21</Retention>
        <FileType>File</FileType>
    </Backup>
</ZipList>

The array I currently build I use to loop thru it later on, and to build hash tables from as well. So, I don’t really want to re-engineer the rest of the powershell script.

However, since it’s easier to make changes to an XML file (as opposed to changing the array inside the script), all I want to do is to duplicate this array in an XML file that would be a little more straightforward & self-documenting to make changes to, read this xml file in and then store it in the array I’m currently creating.

I can get the xml file read in, but I’m having trouble getting the xml data into an array. For the above XML example, the array would look like this:

counter ++
arr1 += ,@(counter,1,"TargetBackup",10,"Folder")
counter ++
arr1 += ,@(counter,2,"SourceBackup",7,"Folder")
counter ++
arr1 += ,@(counter,3,"XMLBackup",21,"File")

and so on….

The issue I am having is that the xml data is in, but it’s a string that I can’t do anything with other than grab it all at once. Any help, suggestions appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:46:47+00:00Added an answer on June 1, 2026 at 12:46 am

    Why not just export that array as clixml. Then its portable, and when you want to use it in your script, just re-import it and you have your array back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently we use jQuery to add RIA goodness to our apps, but recently we
Currently I know of only two ways to cache data (I use PHP but
Currently It just opens up the xml, but i want to get a dialog
Currently, I know there are several official Android styles. @android:style/Theme.Black @android:style/Theme.Light @android:style/Theme.Translucent But I
Currently I have a class that looks like this: public class MyClass : IMyClass
Currently, I have something like: public partial class Form1 : Form { delegate void
Currently I am adding object by creating it like: type TRecord = class private
currently I'm developing an app for WP7 but came across a little problem with
Currently, most of the popular websites, like google, yahoo detect if the user connection
Currently I have in my code tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(addCompoundToLabel:)]; My code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.