Scope vs Runspace vs Session vs AppDomain

I'm struggling to draw borders in my head for PowerShell. My very limited understanding is this:

  • A Scope contains user / script specific variables and functions, and there may be a hierarchy of regions with a PS call stack.
  • Runspace determines which built-in functions this PS instance has access to. Space can cross network boundaries.
  • A session is a specific Powershell instance. They can also cross network boundaries.
  • The application domain (or AppDomain) contains loaded assemblies. In many cases, when data is loaded into the AppDomain, it cannot be uploaded. AppDomain should be removed in favor of the new. If the PS scripts are called through another application, the instantiated PS will inherit the AppDomain of the calling application.

Can someone explain these concepts better? Is there some kind of Venn diagram or something that hides this information? Online documents were not extremely useful.

+5
source share

Source: https://habr.com/ru/post/1263017/


All Articles