Install the PowerShell module like this:
Install-Module -Name DeviceManagement -Scope CurrentUser
This command will always install the latest release. To install a specific version, add the parameter -RequiredVersion
and specify the specific version you want to install.