Issue is while running power shell scripts vcenter passwords is capturing in event logs.
So I am trying yo encrypt before we call vcenter.
I am able to encrypt the password using below
$Pass = "P@ssword1" | ConvertTo-SecureString -AsPlainText -Force
When I run with encrypted password as below
Connect-VIServer -Server $serverName -User $userName -Password $pass
It's not taking encrypted password getting error..
I also tried
$Pass = "P@ssword1" | ConvertFrom-SecureString
Even long encrypted data generated not able to pass as password to vcenter
Can you please help how to pass encrypted password to v center