How to Install

While the source code of the solution is open-sourced on GitHub, the releases of the solutions are being published to the PowerShell Gallery. This means that the tool can be installed onto any machine by running the following PowerShell command:

Install-Module Microsoft365DSC -Force

Installing Microsoft365DSC

Installing Microsoft365DSC

Executing this command can take a minute or two to complete, after which the base Microsoft365DSC module has been installed.

NOTE: Make sure you run the above command in an elevated PowerShell window. In a regular window the module will be installed in the Current User scope, which will not work!

Dependencies

However, Microsoft365DSC depends on several other modules to function properly. For example, it uses the MSCloudLoginAssistant module to delegate all authentication logic to the various workloads, it leverages a dozen Microsoft Graph PowerShell modules to interact with various configuration settings, etc. Current versions of Microsoft365DSC no longer download all the required prerequisites by default. When you install the Microsoft365DSC, you only get the core component after which you have to download all prerequisite modules as well. It is our recommendation that you run the following command to update all dependencies on the system after installing the module:

Update-M365DSCDependencies

Installing Microsoft365DSC Dependencies

Installing Microsoft365DSC Dependencies

Running the above command will automatically read the list of dependencies from the [Module Root]/Dependencies/Manifest.psd1 file, check to see if the proper version of these modules are installed on the machine, and (if not) automatically download them from the PowerShell Gallery and install on the local computer.

Depending on your configuration and the version of PowerShell you are using, the installed modules may be put in different locations. The process of installing a PowerShell module from the PowerShell Gallery really just comes down to downloading the files from the gallery as a zip, extracting them and copying to a location on the system that is associated with PowerShell via environment variables. The following command will allow you to view the version of any given PowerShell module on a system along with its associated version:

Get-Module Microsoft365DSC -ListAvailable | select ModuleBase, Version

Viewing Installed Microsoft365DSC module

Viewing Installed Microsoft365DSC module

Updating To A Newer Version

To update an older version of Microsoft365DSC, use the Update-Module cmdlet and run the Update-M365DSCDependencies cmdlet again to update any dependencies.

Update-Module Microsoft365DSC
Update-M365DSCDependencies

More Information

More information about installing modules: