dataplat / dbatools

šŸš€ SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.44k stars 796 forks source link

Test-DbaLoginPassword, use parametrized query #9097

Closed niphlod closed 1 year ago

niphlod commented 1 year ago

Please read -- recent changes to our repo

On November 10, 2022, we removed some bloat from our repository (for the second and final time). This change requires that all contributors reclone or refork their repo.

PRs from repos that have not been recently reforked or recloned will be closed and @potatoqualitee will cherry-pick your commits and open a new PR with your changes.

Type of Change

Purpose

Use parametrized queries since escaping inputs is .... so 1990.+

Approach

Use Invoke-DbaQuery to run the query, which just has a problem of not being able to support zillions of params in one go. So we split in "regular batches".

I think the query is now fine, although a password set as "@@Name" won't get detected... But I didn't want to completely change every piece of it.

niphlod commented 1 year ago

failures in Copy-DbaDbTableData.Tests.ps1 should be unrelated.

potatoqualitee commented 1 year ago

Thank you, Simone <3 Will rerun the tests

potatoqualitee commented 1 year ago

Beautiful šŸŒ·