Hi @YM,
Thank you for posting to Microsoft Community.
Based on your description, I understand there is an error when you connect to Exchange Online via PowerShell.
The error message you offered could be related to syntax of command.
For that, you could refer to Connect-ExchangeOnline (ExchangePowerShell) | Microsoft Learn for more information.
If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.