maester
maester copied to clipboard
WIP: Import dependency modules in compatible order to avoid shared library conflicts
This pull request introduces the new Import-MtDependency PowerShell function to help avoid issues caused by conflicts in shared libraries that are used by different module dependencies.
This is a work in progress. I still need to integrate my code that makes it work on non-Windows platforms. It also needs the ability to detect what instance of each module will be imported if/when it is installed in the CurrentUser scope and AllUsers scope (or in other locations included in the PSModulePath environment variable).
New Functionality for Dependency Management:
powershell/internal/Import-MtDependency.ps1: Added theImport-MtDependencyfunction to handle the loading of PowerShell modules in a compatible order by analyzingMicrosoft.Identity.Client.dllversions. This function ensures modules are loaded in descending version order to prevent assembly loading conflicts. It also includes verbose logging, error handling, and a working draft for future enhancements.
Updates to Connect-Maester.ps1:
- Dependency resolution integration: Updated
Connect-Maester.ps1to useImport-MtDependencyfor importing required modules based on the selected services (Graph,Azure,ExchangeOnline,Teams, etc.). This ensures proper dependency management when connecting to multiple services. - Syntax Highlighting: Added PowerShell syntax highlighting to an example command for improved readability in the documentation.