Reputation: 210
Is it possible to call psql with passwords encrypted in Powershell?
There are many documents that describe hiding passwords with Get-Credential, ConvertFrom-SecureString and ConvertTo-SecureString. Even though that's not a perfect solution, I'd like to try that for on PostgreSQL passwords in a PowerShell script.
But, psql is not accepting the password passed by ConvertTo-SecureString.
Is there a way to do it?
Upvotes: 0
Views: 81
Reputation: 210
Actually, below commands worked after upgrading to PowerShell 7. It returned the original password in plain text.
ConvertTo-SecureString | ConvertFrom-SecureString -AsPlainText
Upvotes: 0