I want to make connection to SQL server configured on On prem using Powershell. But I don't want to pass any credential in connection string as shown below
#making a db connection string
$connString = "Data Source=$SqlServer;Database=$Database;User ID=$SqlAuthLogin;Password=$SqlAuthPw"
#Create a SQL connection object
$conn = New-Object System.Data.SqlClient.SqlConnection $connString
#Attempt to open the connection
$conn.Open()
Is there any other way from which i can pass credential.
Any help will be thankfull.