Scope of variables

The different scopes for the variables used in Powershell

Information This article was written for a presentation of the French Powershell UserGroup. This presentation can be seen on Youtube on the FRPSUG channel The scope of variables in Powershell Several scopes are possible for the use of variables according to need Some basic rules: An element that you include in a scope is visible in the scope in which it was created and in any child scope, unless you explicitly make it private If you create an element in a scope and the element shares its name with an element in another scope, the original element can be hidden under the new element. [Read More]