July 27th, 2015

PowerTip: Find PowerShell Variables Defined for AllScope

Doctor Scripto
Scripter

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'})

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.