I'm struggling to draw the boundaries in my head for PowerShell. My very limited understanding is this:
- A Scope contains user/script defined variables and functions, and there can be a hierarchy of scopes with a PS call stack.
- A Runspace dictates what built-in functionality a given PS instance has access to. A Runspace can cross network boundaries.
- A Session is a specific instance of Powershell. These can cross network boundaries as well.
- An Application Domain (or AppDomain) contains loaded assemblies. In many cases, once data has been loaded into an AppDomain, it cannot be unloaded. The AppDomain must be disposed of in favor of a new one. If PS scripts are invoked via another application, the PS instance that gets created inherits the AppDomain of the invoking application.
Can anyone explain these concepts better? Is there some sort of Venn diagram or something that fleshes this information out? The online docs haven't been extremely helpful.