Page 1 of 1

[PSS2014] Intellisense for XML - script writing

Posted: Tue Sep 16, 2014 12:43 pm
by aaronta
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
Image