microsoftgraph / microsoftgraph/entra-powershell
Design entra-powershell with ALC bridge pattern for a more robust assembly load handling
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 213
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
Describe the feature
People usually use not only one but several PowerShell modules, which often cause assembly conflicts depending on the order the modules were loaded or used.
Developers of a given module often "lives in a bubble" where everything inside the module works fine, but in real-life scenarios, where multiple modules from multiple providers are used, they might fall short due to assembly load design of the module.
Enter Assembly Load Contexts (ALCs). ALCs were introduced in .NET Core 1.0 to specifically address the need to load multiple versions of the same assembly into the same runtime.
ALC is the "new" way of loading assemblies in PowerShell 7, and should have better ways of handling multiple versions of the same assembly. There are a few samples in the code below that show how to avoid this breaking code into two modules and using the IModuleAssemblyInitializer to lazy load and undload assemblies into ALC.
How will this feature enhance your project and further the project’s overall goals? Who will benefit from this feature (i.e. all users; the project team)?
Try and do a search on Az, MgGraph, PnP.PowerShell github issues lists or other foras. One of the most common issues with PowerShell modules are assembly conflicts (our new "dll-hell") due to the fact that a module loads a dll when a certain function is used, and depending on module versions and order the involved PowerShell modules was loaded, errors will occur.
ALC bridging pattern makes it possible to load multiple versions of the same assembly, hence minimizing the assembly conflicts and resulting in a more robust module and less frustrated users :)
Describe alternatives you've considered
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked PowerShell dependency-conflict guidance and its Assembly Load Context bridge samples, then inspect how this module currently loads assemblies. The issue names no files or tests; completion would require agreeing on the bridge design and demonstrating that multiple module versions can load without assembly conflicts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100