I would like to connect to Exchange online using my cred like this :
$Username = "[email protected]"
$PasswordPath = "C:\PowerShell\password.txt"
#Read the password from the file and convert to SecureString
$SecurePassword = Get-Content $PasswordPath | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PSCredential -ArgumentList $Username, $SecurePassword
But I got an issue while tryign to Convert to String as Below
I used .txt file only

