[PSS2014] Intellisense for XML - script writing

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
User avatar
Posts: 6
Joined: Wed Mar 27, 2013 12:51 pm

[PSS2014] Intellisense for XML - script writing

Post by aaronta » Tue Sep 16, 2014 12:43 pm

Hard to explain what I meant just on the subject line...

but basically, I am using an XML file for setting global variables (i.e. SMTP Servers, script admin email address, etc etc.) by using this:
PowerShell Code
Double-click the code block to select all.
[xml]$Glbl = GC C:\common\SCRIPTS\GlobalVars\Settings.xml

now, the problem here is, the variable $glbl doesn't populate with the settings from the XML file. So to get round this in PowerGUI and Powershell ISE, you would run that part of the script first and then the variable would populate, allowing you to use Intellisense while you're writing your script.

Picture of what I mean, just in case I'm terrible at explaining