Efcore: Error with scaffold-dbcontext when the password has "$"

Created on 27 Sep 2016  路  2Comments  路  Source: dotnet/efcore

Steps to reproduce

I ran:
scaffold-dbcontext "server=127.0.0.1\sql14;database=CommonDEV;user id=GSUser;password=C$$_xxxxxxx;persist security info=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -verbose

The issue

It produced an error that the login failed for the user. When I looked at the connection string in the output, it was replacing the "$" characters: password=Cprompt_xxxxxxxx. When I changed the password to not include the "$", it worked as expected.

closed-external

Most helpful comment

In PowerShell $$ contains the last token in the last line received by the session. You'd need to escape it using `$$, or use single quotes around your connection string.

All 2 comments

In PowerShell $$ contains the last token in the last line received by the session. You'd need to escape it using `$$, or use single quotes around your connection string.

(lol, figuring out how to format that answer in Markdown was even harder)

Was this page helpful?
0 / 5 - 0 ratings