Neil Barnwell
Projects, Scripts, and Modules
Invoke-ParameterisedSqlQuery.ps1
(gist.github.com)
Invoke-SqlCmd doesn't support parameterised queries, so you have to resort to magic strings, and
By: Neil Barnwell submitted:Jun 16 2022
Invoke-SqlCmd doesn't support parameterised queries, so you have to resort to magic strings, and
possibly leave yourself open to SQL injection attacks. While you may be the only one using your script, it's likely that you're using values you're getting from a database, file, or some other external source. So I finally got around to writing a function that supports parameterised queries, and thought I'd offer it up in case others find it useful.
By: Neil Barnwell submitted:Jun 16 2022