How to use password with encryption while connecting to Connect exchange online

Hi Team,
I am trying to run a script where i need to connect excahnge online, i like to have the password entered in the script, which means, i want to enclose the password while connecting to exchange online
eg:

Connect-ExchangeOnline -UserPrincipalName xyz.123@test.onmicrosoft.com

Thanks
Vel

You could take a look at the new SecretManagement module from MSFT:

Microsoft.PowerShell.SecretManagement Module - PowerShell | Microsoft Docs.