PowerTip: Find PowerShell Variables Defined for AllScope

Doctor Scripto

Dr Scripto

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

0 comments

Comments are closed. Login to edit/delete your existing comments