Pash-Project/Pash — pull request #176 by sburnicki (2013-11-11 18:02:19+00:00)
Title: Introduced scope class to change architecture to support scopes

Pash's architecture had no support for scopes. Instead, there was just
one global scope. These changes are the start of scope implementation.

While the "global scope" bahvior isn't changed, yet, the architecture
is changed to support scopes in regard to variables and drives.
The new class, SessionStateScope, is the new heart of a SessionState
and is intended to support nested scopes. The SessionStateGlobal class
is intended to care about the not-scope related things as providers.
An important change is that SessionStates aren't simple copy-objects
that are created every now and then, but only if it's really necessary.

There are further steps that need to be done to fully support scopes:

* While VariableIntrinsics and DriveManagementIntrinsics already implement
the new scope behavior, the alias and function scope support still has
to be added.

* Once this is completed, the creation of SessionStates has to be adjusted even
more in order to correctly create new scopes.

* The existing cmdlets (new-variable, etc) need to be re-written to better
support scopes, read-only flags, etc.

* There should be some refactoring of existing code. SessionState should
be used as a central object to modify the sessions data.

Important: You don't need to merge this now, if you don't want to. However, I created this request such that you can take a look at my plans and the code to provide comments. So if you spotted anything or have questions, please feel free to comment. I will go on with implementing scope support for aliases and functions. After each of the proposed steps, I will update this merge request or create a new one, if this one was already merged then.