PowerShell for Office 365, now Microsoft 365, allows you to manage your environment from the command line and the various services that exist in the Microsoft 365 environment, including using it to connect to Exchange Online Powershell. The first step required to connect to Office 365 or Microsoft is to install the required software. Run this command to install the basic Azure AD module for working with Office 365/Microsoft 365 from the command line, Install-Module -Name AzureAD. After this to connect to Exchange Online Powershell, you install the ExchangeOnlineManagement module mentioned above for the Office 365 connect to Exchange Online PowerShell process
Install-Module PowershellGet -Force
Update-Module PowershellGet
Install-Module -Name ExchangeOnlineManagement