I have the following connection string
{"Authentication Kind":"UsernamePassword","Username":"someID1","Password":"Yu#gh456!ts","EncryptConnection":true}
I am trying to show the password with ******* , so I need to convert it to SqlConnectionStringBuilder type as its easy to replace properties with that. I am using it just fine for non-json structured strings
[System.Data.SqlClient.SqlConnectionStringBuilder]::New('{"Authentication Kind":"UsernamePassword","Username":"someID1","Password":"Yu#gh456!ts","EncryptConnection":true}')
i am getting this error:
Cannot convert value to type System.Data.SqlClient.SqlConnectionStringBuilder
How do I convert it to a connection string thats acceptable by the SqlConnectionStringBuilder type?
SqlConnectionStringBuilderinstance, or are you just using it for structured access to / display of the input string's fields?;-separated list of key-value pairs is not enough in your case, because the JSON contains property (field) names thatSqlConnectionStringBuilderdoesn't recognize, such asUsername.