Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
about_Scopes is missing an important concept: internal "session states" #4288
Documenting these in about_Scopes and giving them a descriptive official name is important.
The summary is:
In other words: the only shared ancestral scope whose definitions are visible to both module and non-module code is the global scope.
I propose not calling these distinct scope hierarchies session states, because the latter suggests a concept relating to a session as a whole, which is confusing. Additionally, global session state is confusing, because only its root scope is truly global. Finally, it is confusing that the word scope is not in the name at all.
(As far as I know, the concepts aren't currently explained anywhere, but the confusing terms are used in https://docs.microsoft.com/en-us/powershell/developer/module/how-to-write-a-powershell-module-manifest)
I propose the term scope domain for these distinct scope hierarchies, but that is open to debate:
Perhaps scope stack is a better alternative (though, strictly speaking, it can be a tree in that multiple sibling child scopes can exist in a single pipeline).
Version(s) of document impacted
referenced this issue
May 9, 2019
Personally I still like
Ultimately I suggest sticking with the terms used by the engine (e.g.
Given your explanation, I'm leaning towards stack as well.
As for sticking with the internally used terms:
Creating a disconnect between the terminology used in the documentation and the one in the source code is unfortunate, but unavoidable if the priority is to provide descriptive, non-confusing terms to end users (and the source-code terminology doesn't meet that bar) - and I think it should be the priority.
Most end user will likely never look at the source code and therefore needn't know internally used names.
I think it would be sufficient: