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

Connect-ExchangeOnline -UserPrincipalName


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

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