Assemblies
.NET objects are implemented within assemblies. An assembly may be static (based on a file) or dynamic (created in memory).
Many of the classes we might commonly use exist in DLL files stored in %SystemRoot%\Assembly
. The list of currently loaded assemblies in a PowerShell session may be viewed using the following statement:
[System.AppDomain]::CurrentDomain.GetAssemblies()
Once an assembly, and the types it contains, has been loaded into a session, it cannot be unloaded without completely restarting the session.
Much of PowerShell is implemented in the System.Management.Automation
DLL; details of this can be shown using the following statement:
[System.Management.Automation.PowerShell].Assembly
In this statement, the type PowerShell is chosen to get the assembly. Any other type in the same assembly is able to show the same information. The PowerShell type could be replaced with another in the previous command, for example:
[System.Management.Automation.PSCredential].Assembly
[System...