Closed Matteo-T closed 1 year ago
This is a fairly old issue introduced in v21 of the PS6+ version of Invoke-Sqlcmd (the same v21 on PS5 is working fine). Most likely a bug in the Managed BatchParser code that is not parsing the code correctly. I'll follow-up with an issue in the SqlToolsService repo soon.
Simple repro (compile for net7.0 after adding a reference to Microsoft.SqlTools.ManagedBatchParser.dll, then run):
Result:
Expected:
This repro originated from the https://github.com/microsoft/SQLServerPSModule repo, but in reality, it's a bug in the ManagedBatchParser. I've
Original title was
Invoke-Sqlcmd does not parse correctly some string literal containing strings that resemble variables
Run the following cmdlet:
Result:
Expected: