dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 788 forks source link

Copy-DbaCredential: Fix for credentials with square brackets in it's name - Issue #9242 #9243

Closed ibaxo closed 4 months ago

ibaxo commented 5 months ago

Proposed fix for issue #9242 https://github.com/dataplat/dbatools/issues/9242

$decryptedCredentials items already contain a property .Quotename which is escaped correctly by QUOTENAME function. One possible fix could be to use the value from .Quotename property instead of $credentialName variable

potatoqualitee commented 4 months ago

Nice fix! Thank you 🙇🏼