David Seis looks at a powerful cmdlet in dbatools:
In this blog post, we will audit the dbatools command Invoke-DbaQuery. I will test, review, and evaluate the script based on a series of identical steps. Our goal is to provide insights, warnings, and recommendations to help you use this script effectively and safely. Invoke-DbaQuery is the Swiss army knife of all dbatools commands as you can execute almost any T-SQL script you can think of via PowerShell.
Click through for an overview of what the cmdlet does, some tips on proper usage, and an important note around possible misuse.