Hi,Anant Bera
Using a certificate is not directly related to requiring a plaintext password. PowerShell uses Windows authentication by default, so it does not require entering a plaintext password. If you log in using a SQL Server user and want to hide the plaintext password, please use Virtual drive.
The sqldrive function prompts you to enter the password for your login, masking the password as you type it in.
Alternatively, you can use the sqlcmd utility to avoid directly typing a plaintext password in the connection string.
Using
-P
should be considered insecure. Avoid giving the password on the command line. Alternatively, use theSQLCMDPASSWORD
environment variable, or interactively input the password by omitting the-P
option.
Best Regards,
Mikey Qiao
If you're satisfied with the answer, don't forget to "Accept it," as this will help others who have similar questions to yours.