PowerTip: Find PowerShell Variables Defined for AllScope


Summary: Find Windows PowerShell variables that are defined for all scopes.

Hey, Scripting Guy! Question How can I find  what variables are defined as AllScope in my Windows PowerShell environment?

Hey, Scripting Guy! Answer Get a list of all your variables, and filter for options that include AllScope, for example:

(dir variable:).where({$_.options -match 'allscope'})

Comments (0)

Skip to main content