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 9171341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:08:59+00:00 2026-06-17T16:08:59+00:00

I have a project to create a script to handle our Lync provisioning –

  • 0

I have a project to create a script to handle our Lync provisioning – trying to keep it as modular as possible. I think this works best by keeping each script file in its own directory, with its own ‘scopedConfig’ & a ‘centralXML’ with tags that are globally useful.

The problem I have is when trying to import 2 XML files consecutively using Get-content.

The code I have is:

# Import CentralConfig
[xml]$centralXML = Get-content ".\centralConfig.xml"

# Import ScopedConfig
[xml]$scopedXML = Get-content ".\ExecutionResources\ScopedConfigfiles\HostConsole\config.xml"

I’m testing successful import with the following:

"------------------"
"------------------"
$centralXML
"------------------"
$scopedXML
"------------------"
"------------------"

The result and where the issue lies is the output:

------------------
------------------
Global_ConfigRoot
-----------------
Global_ConfigRoot
------------------

------------------
------------------

I expected the root nodes of both XMLs as output, instead I only get the root node of the first. If I swap it round so that $scopedXML is first – I only get $scopedXML root node and nothing from $centralXML.

An interesting thing to note is that if I pipe the 2nd XML to Get-member – where you’d usually expect to see all XML related things and it’s properties, I get a whole load of blankness:

------------------
------------------
Global_ConfigRoot
-----------------
Global_ConfigRoot
------------------














































------------------
------------------

I have never come across this before, does anyone have any suggestions?

(PS Tried my best to keep to the posting rules, let me know if anything is wrong it’s my first time posting here)

  • 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-17T16:08:59+00:00Added an answer on June 17, 2026 at 4:08 pm

    A function, cmdlet or script can only return AN object. It you return mulitple like you do by calling both variables, it actually returns an object[] array containing both items (+ the lines you printed). The objects are untouched and just added to this collection.

    Now, when your script outputs(displays) the object that was returned, it formats it as a table since there were multiple objects inside. A table can only contain 1 header(column-names), and when displaying an array, it takes the columns(properties) from the first item, in this case $centralxml. That’s why you get 2 columns: xml and servers.

    If you want to seperate them you have to tell the script to format them in seperate tables. Ex:

    # Import CentralConfig
    [xml]$centralXML = Get-content ".\test.xml"
    
    # Import ScopedConfig
    [xml]$scopedXML = Get-content ".\test2.xml"
    
    $centralXML | Format-Table
    $scopedXML | Format-Table
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project to create a program, which prevents the user from escaping
I have a project where I create WiX (Windows Installer for XML) files, when
So for my programming class we have had a project to create a virtual
I have a project using DynamicJasper to create reports. It works fine so far,
I have a Create View page in my MVC3 project to create instances of
I have Maven project with Hibernate and Spring framework. I want Hibernate to create
I have created my database, and used cake bake my_project to create my project,
For a project I have to create a music visualizer in java (I've decided
For a project we have a requirement to create an interfacedefinition that will return
I have a maven project and I'd like to create a distribution of it

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.