Learn about Windows PowerShell
Summary: Learn how to identify automatic variables.
How many types of automatic variables exist by default? And how would you discover such a thing?
There are five types of automatic variables that exist by default.
To discover them, use the variable provider and the Get-Member cmdlet:
PS C:\> dir variable: -Force | gm | select typename | sort typename -Unique
TypeName
--------
System.Management.Automation.LocalVariable
System.Management.Automation.NullVariable
System.Management.Automation.PSVariable
System.Management.Automation.QuestionMarkVariable
System.Management.Automation.SessionStateCapacityVariable
Always helpful.
Vote +1 if you had to google what an automatic variable was.
@Livio von Buren, great. I am glad you found it helpful.
@Knuckle-Dragger, sorry about that. I am trying to walk a fine line with these PowerTips between a simple one line tip, and a full blown blog article. The good thing, is that now you know what an automatic variable is :-) By the way, I have written a lot of articles where I talked about automatic variables blogs.technet.com/.../searchresults.aspx