Note that there are some explanatory texts on larger screens.

plurals
  1. POConsecutively import XMLs into powershell script
    primarykey
    data
    text
    <p>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' &amp; a 'centralXML' with tags that are globally useful. </p> <p>The problem I have is when trying to import 2 XML files consecutively using Get-content. </p> <p>The <strong>code</strong> I have is: </p> <pre><code># Import CentralConfig [xml]$centralXML = Get-content ".\centralConfig.xml" # Import ScopedConfig [xml]$scopedXML = Get-content ".\ExecutionResources\ScopedConfigfiles\HostConsole\config.xml" </code></pre> <p>I'm <strong>testing</strong> successful import with the following: </p> <pre><code>"------------------" "------------------" $centralXML "------------------" $scopedXML "------------------" "------------------" </code></pre> <p>The <strong>result</strong> and where the issue lies is the output:</p> <pre><code>------------------ ------------------ Global_ConfigRoot ----------------- Global_ConfigRoot ------------------ ------------------ ------------------ </code></pre> <p>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.</p> <p>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:</p> <pre><code>------------------ ------------------ Global_ConfigRoot ----------------- Global_ConfigRoot ------------------ ------------------ ------------------ </code></pre> <p>I have never come across this before, does anyone have any suggestions?</p> <p>(PS Tried my best to keep to the posting rules, let me know if anything is wrong it's my first time posting here)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload