Share via

Microsoft DSC Pipeline module error "Multiple versions of the module 'M365Config'"

Anonymous
2023-06-14T12:12:28+00:00

When setting up the CI/CD pipeline from the pdf "Managing Microsoft 365 in true DevOps style with Microsoft365DSC and Azure DevOps" from Yorick Kuijs I get a pipeline error in the compile step at AzurePowerShell:

"Multiple versions of the module 'M365Config' were found. You can run 'Get-Module -ListAvailable -FullyQualifiedName M365Config' to see available versions on the system, and then use the fully qualified name '@{ModuleName="M365Config"; RequiredVersion="Version"}".

Tried different OS with no succes.

Microsoft 365 and Office | Install, redeem, activate | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2023-06-14T13:19:22+00:00

    Dear MarcusJaken

    Good day! Thank you for posting to Microsoft Community. We are happy to help you!

    Very happy to hear that your problem has been solved! Thank you very much for sharing your solution process in our forum, I believe that your answer will help more users who encounter similar problems to you, and your answer will make the work more efficient. Once again, sincerely thank you for your contribution!

    In the meantime, if you need help with any questions in the future, please let me know and I will try to do more research and testing to help you better!

    Thank you in advance for your understanding! Your patience and cooperation will be greatly appreciated. Hope all the best!

    Sincerely

    Kerry Chen | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-06-14T13:13:21+00:00

    Solved;

    I added these lines to the pipeline yaml config file:

    Update-Module Microsoft365DSC

    Update-M365DSCDependencies

    Uninstall-M365DSCOutdatedDependencies

    as a Inline script


    ..

    stages:

    • stage: Compile jobs:
      • job: CompileConfiguration steps:
        • task: AzurePowerShell@5 inputs: azureSubscription: KeyVaultConnection ScriptType: 'InlineScript' Inline: |
          Install-Module -Name PowerShellGet -Force -AllowClobber 
          
          Install-Module -Name Microsoft365DSC -Force 
          
          Update-Module Microsoft365DSC 
          
          Update-M365DSCDependencies 
          
          Uninstall-M365DSCOutdatedDependencies 
          
          .\build.ps1 
          
          azurePowerShellVersion: latestVersion pwsh: true errorActionPreference: 'stop' failOnStandardError: true

    ..


    Was this answer helpful?

    0 comments No comments