PowerTip: Examine Automatic Variables

Summary: Learn how to identify automatic variables.

Hey, Scripting Guy! Question How many types of automatic variables exist by default? And how would you discover such a thing?

Hey, Scripting Guy! Answer 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








Comments (3)

  1. Vote +1 if you had to google what an automatic variable was.  

  2. Ed Wilson says:

    @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