Using only $cred.password from Get-Credential

i have a issue, i obtain username and password by prompting Get-Credential . ad saved in $cred variable.
I can see $cred.username return my email address and $cred.password as a secure string.
I had to use my email, which i can obtain by using $cred.username and it works . But when i wanted to use password in the script by using $cred.password. i can see my sendkeys type the password, but it failed saying incorrect password.
But if i type my password in a variable and use that it works.

I dont want use plain password in my script. Any ideas will be helpful. Thank you in advance.

We can hardly recommend something meaningful without seeing your actual code. :man_shrugging:t4: