You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to run Microsoft 365 DSC (M365 DSC) commands within a CI pipeline in GitLab. However, my organization has blocked access to the PowerShell Gallery due to network security policies, and I am unable to set up a proxy to access it.
As a workaround, I downloaded the required DSC modules and pushed them to Artifactory (a remote repository). In the pipeline, I am downloading and unzipping the modules, and then running the following command to import the module:
Import-Module "$modulePath/Microsoft365DSC.psd1"
After successfully importing the module, I attempt to execute the Export-M365DSCConfiguration command using secret credentials. However, I encounter the following error:
Write-Error: Failed to export M365 DSC Configuration: The term 'Connect-M365Tenant' is not recognized as the name of a cmdlet, function, script file, or executable program.
When running the script locally, I would typically use the Update-M365DSCDependencies command to ensure all required dependencies are installed and updated, but this is not possible in my current CI pipeline setup due to the lack of PowerShell Gallery access. I understand that M365DSC relies on several other modules for its functionality, which are likely out of date in my current environment.
Questions/Clarifications:
Is there a way to manually identify which specific modules M365DSC depends on so that I can download and update them independently?
Is it necessary to have the most up-to-date version of M365DSC and all its dependencies to resolve the Connect-M365Tenant error, or is there another potential solution I can implement in my CI pipeline to bypass this issue?
The text was updated successfully, but these errors were encountered:
@RosalindHook The required modules with their versions for the current version of Microsoft365DSC can be found here: Modules/Microsoft365DSC/Dependencies/Manifest.psd1. If you install the modules in the system context before running any other commands of the Microsoft365DSC module, you should be fine.
I am having a related issue with the dependency PSDesiredStateConfiguration. If I run the command to update all dependencies, everything updates to the versions in the manifest with the exception of PnP.PowerShell. I get this warning:
WARNING: The dependency {PSDesiredStateConfiguration} requires PowerShell Core. Please run Update-M365DSCDependencies
in PowerShell Core.
But I thought the recommendation was to use PowerShell 5.x with DSC? Therefore what should I do about this one dependency requiring a different version?
If you were to use PowerShell 7, you would need to install that module in the PowerShell 7 shell. If you don't use that, you can safely ignore the message. Current suggestion is, as you wrote, PS 5.1.
I am attempting to run Microsoft 365 DSC (M365 DSC) commands within a CI pipeline in GitLab. However, my organization has blocked access to the PowerShell Gallery due to network security policies, and I am unable to set up a proxy to access it.
As a workaround, I downloaded the required DSC modules and pushed them to Artifactory (a remote repository). In the pipeline, I am downloading and unzipping the modules, and then running the following command to import the module:
After successfully importing the module, I attempt to execute the Export-M365DSCConfiguration command using secret credentials. However, I encounter the following error:
When running the script locally, I would typically use the Update-M365DSCDependencies command to ensure all required dependencies are installed and updated, but this is not possible in my current CI pipeline setup due to the lack of PowerShell Gallery access. I understand that M365DSC relies on several other modules for its functionality, which are likely out of date in my current environment.
Questions/Clarifications:
The text was updated successfully, but these errors were encountered: