Install-Module -Name AzureAD Import-Module AzureAD Connect-AzureAD Install-Module MSOnline Connect-MsolService

Sources

https://learn.microsoft.com/en-us/microsoft-365/enterprise/connect-to-microsoft-365-powershell?view=o365-worldwide

https://learn.microsoft.com/en-us/microsoft-365/enterprise/manage-microsoft-365-tenants-with-windows-powershell-for-delegated-access-permissio?view=o365-worldwide