The components of .NET
Before we can start using the .NET libraries, we need to understand how they are structured. Members (properties, methods, etc.) are contained inside types, which in turn are contained in namespaces. This is logical type containment. There is also physical type containment. These logical structures are physically held in assemblies. We’ve already seen many of these components in PowerShell. Let’s start with assemblies.
Assemblies
Assemblies are collections of types and the resources needed to support them. They can be either static, loaded from a file, or dynamic, existing solely in memory. PowerShell will load a number of default assemblies at startup, and then, as we import modules, that list will expand. We can see the list of assemblies we have loaded with the following:
[System.AppDomain]::CurrentDomain.GetAssemblies()
That will output a table like this:
Figure 16.1 – Enumerating assemblies
We...