I had the chance to watch dbatools in action recently at SQL Saturday Cambridge. I watched a presentation from Chrissy LeMaire (@cl) that was impressive in how easy she made a number of DDL type changes between instances.
I decided to give some of these new cmdlets a try, since I was impressed with the work done. The first step in trying one is to get the dbatools module. If you go to the dbatools.io site and click the download link, you get great instructions.
The first thing I did was start a command line as an administrator, then run Powershell. From there, it’s a simple “Install-Module dbatools” command. As you can see below, you’re asked if you want to actually do the install. If you do, then things just work.
First, I’ll type “copy-sql”, as shown here.
When I hit TAB, I get the first matching item. Hmm, I’ve never seen Copy-SQLAgentCategory. Not that I’d ever done this, but this is certainly going to be simpler than digging through DMVs or reading BOL.
Hit TAB again and get the next Copy-Sql command.
In fact, there are lots of Copy-, Export-, Test-, Get-, and more cmdlets. It’s a very handy list, and the types of things I’m stunned Microsoft just didn’t provide.
I’ll be digging in a bit more and looking at how some of these items work, as I suspect these will be invaluable for DBAs that need to manage and migrate various settings at any scale across systems.