Thor Logo dbatools

Blog

Latest articles and updates from the dbatools community

I ❤ Invoke-DbaQuery

Pétur Grétarsson

Jan 8, 2018

Updated: Oct 29, 2025

Pétur Grétarsson, here. Long time dbatools fan, first time blogger. I really love the new Invoke-DbaQuery command and wanted to share how I use it. I have well over 100 Availability Groups to look after in different domains so it can be a bit difficult to check things when needed. We have opened required ports allowing connections from one SQL management server to those for monitoring purposes including using Idera SQL Inventory Manager for basic health checks.

Read more

Website Updates

Chrissy LeMaire

Dec 1, 2017

We’ve updated the site a bit and wanted to let you know. Getting Started Finally! The Getting Started page has accurate information, way more code samples and useful links. So if you’re a bit lost wondering where to start, I included a slightly modified version of the code I often show at conferences. This code in particular was heavily updated just a few weeks ago for the dbatools presentation in Glasgow.

Read more

Cleaning Up Comment-Based Help

Andy Levy

Nov 29, 2017

Updated: Oct 29, 2025

Hey all! Andy Levy here. I’m a SQL Server DBA and major contributor for dbatools. My current focus within the project is fixing the docs and more specifically, the help content and documentation that’s included with every function. Most folks don’t like writing documentation. It’s seen as a necessary evil, something you do to just check a box, complete requirements, and move on. With many open source projects, you’re lucky to get much documentation at all.

Read more

Getting Complex with Restore-DbaDatabase

Stuart Moore

Nov 28, 2017

No matter how hard the dbatools team tries, there’s always someone who wants to do things we’d never thought. This is one of the great things with getting feedback direct from a great community. Unfortunately a lot of these ideas are either too niche to implement, or would be a lot of complex code for a single use case. As part of the Restore-DbaDatabase stack rewrite, I wanted to do make things easier for users to be able to get their hands dirty within the Restore stack.

Read more

Improving Tests: Code Coverage Use Case

Simone

Nov 17, 2017

Updated: Oct 29, 2025

A recent addition to the release pipeline is the “code coverage” report. Although you can find several posts about the intricacies of code coverage for PowerShell, you may be asking yourself what is code coverage in simple terms. Defining Code Coverage Coupled with tests, code coverage is a metric that measures how much of the code is tested. This is helpful to realize the test written is really covering for all the “features” of the code.

Read more

New Release - PickleRick

Chrissy LeMaire

Nov 17, 2017

Updated: Oct 29, 2025

I have to wake up at 3am to go to the airport and start a solid two weeks of vacation, so I’ll keep this incredibly short. Tonight, we released picklerick. It has 323 super useful, tested commands but what’s especially great about this release is that now, we get along better with your SQL Servers. We no longer hang out longer than we’re supposed to and dbatools creates connections that are part of the SQL Connection Pool.

Read more

Our Prompt

Chrissy LeMaire

Oct 25, 2017

Updated: Oct 29, 2025

A few months back, dbatools wizard Fred created a prompt that was so awesome, I never had to use Measure-Command again. It was cool enough that a number of us ended up adopting it, so I figured I’d share. Performance is important to us so that’s what the prompt is all about. Nothing fancy, just the current working directory and how long the command took to run. PowerShell [16:46:06] C:\github\dbatools> Get-DbaDatabase -SqlInstance sql2016 -Database master ComputerName : sql2016 InstanceName : MSSQLSERVER SqlInstance : sql2016 Name : master Status : Normal IsAccessible : True RecoveryModel : Full LogReuseWaitStatus : Nothing SizeMB : 92 Compatibility : Version130 Collation : SQL_Latin1_General_CP1_CI_AS Owner : sa LastFullBackup : 10/11/2017 2:39:07 PM LastDiffBackup : 1/1/0001 12:00:00 AM LastLogBackup : 1/1/0001 12:00:00 AM [16:46:21][740.

Read more

Walk-Thru: Installing Modules from the PowerShell Gallery

Chrissy LeMaire

Oct 18, 2017

Updated: Oct 29, 2025

Before Apple created the App Store and Microsoft created the Microsoft Store, Linux users basked in the glory of how easy it was to install programs or packages from centralized stores using Package Managers and remote repositories. For years, power users requested a PowerShell version of apt-get and in 2014 Microsoft delivered with the introduction of the PowerShell Gallery and an accompanying module that allowed users to just Install-Module to install new modules, PowerShell’s version of a package.

Read more

Introducing the Community-Driven Build Reference

Simone Bizzotto

Oct 16, 2017

Updated: Oct 29, 2025

Yet another post from the dbatools team, I’m Simone Bizzotto. Hit me up on Slack, I’m @niphlod. The Problem Even the accidental DBA has to manage those pesky SQL Server Updates. Be it a bug fix, a security fix, a “new features” release, well… it needs to be installed. Put auditor in the mix: what build are you on ? Put your bosses’ boss in the mix: is the farm still officially supported by MS ?

Read more

PASS Summit PowerShell Precon Agenda Now Available

Chrissy LeMaire

Oct 8, 2017

Updated: Oct 29, 2025

We’ve been working on our precon and we’re super excited to share the agenda with you! In Case You Missed It dbatools teammates Constantine Kokkinos, Rob Sewell and I will be presenting a full-day session at PASS Summit in Seattle, WA, USA on Tuesday, October 31, 2017! Our precon will have a lab and we’re nearly at capacity — you’ll need to sign up now to ensure a spot. Major Contributors Shawn Melton, Sander Stad and Brandon Abshire will help proctor the docker-based SQL Server lab.

Read more

Scheduling PowerShell Tasks with SQL Agent

Chrissy LeMaire

Sep 26, 2017

Updated: Oct 29, 2025

We’ve had a lot of people ask about the best way to schedule dbatools tasks in SQL Server Agent. I recently switched Agent from Task Scheduler and here’s what I learned. tl;dr for those of you who just want to skip the commentary of pros vs cons and head straight to the tutorial, click Scheduling PowerShell Tasks using Agent’s CmdExec. Task Scheduler Task Scheduler was decent but ultimately, not as cool as SQL Server Agent for a number of reasons:

Read more

287 Commands and Counting

Chrissy LeMaire

Sep 13, 2017

Updated: Oct 29, 2025

Last month, I went through an audit that consumed every waking moment of my life. I would literally wake up, get ready for work, grab the three meals my wife made for me, go to work for 16-18 hours, come back, sleep then wake up, rinse, repeat. I tried to stay as healthy as possible by prioritizing sleep, taking vitamins, eating vegetarian meals that were easy to digest and drinking tea (and not energy drinks) as an energy source.

Read more

Performing a Migration With Every Commit: Testing With Pester and AppVeyor

Chrissy LeMaire

Sep 12, 2017

Updated: Oct 30, 2025

Not a Snoozefest You may be thinking “oh man, a post about testing. booooring!” I used to, too, but have since come around and now find that creating tests is actually a lot of fun 🎉. I even have a personal goal that that every command touched by a PR gets a corresponding test. That way, we know the command works as expected and will continue to with each and every merge.

Read more

24 Hours of PASS Presentation - Now Online

Chrissy LeMaire

Aug 3, 2017

Updated: Oct 29, 2025

Constantine and I recently presented for 24 Hours of PASS and the video is now online! Our goal in this intro-level session was to help make PowerShell feel approachable and demonstrate its immediate value with commands like Get-DbaLastGoodCheckDb, Test-DbaSpn and Invoke-DbaDiagnosticQuery. Slides | Demo Code Entire Presentation | Demo Portion of Presentation | Included SPN Sample Video If you’re already familiar with the project and would like to bypass the intro, you can jump right to the demo.

Read more

Offline Installs of dbatools

Chrissy LeMaire

Jul 26, 2017

Updated: Oct 29, 2025

If you work in a secure environment or your computers cannot access the Internet for any reason, you can still install dbatools with ease by downloading the zip from a workstation that does have Internet access 🎉 And now that our module is digitally signed, you can keep your Execution Policy set to AllSigned, too. There are essentially 3 ways to get the zip of our module From PowerShell Gallery using Save-Module From PowerShell Gallery by downloading from powershellgallery.

Read more

Can You Help Us Test This Beta?

Chrissy LeMaire

Jul 4, 2017

Updated: Oct 29, 2025

Well, first we’d like to give a big ol’ shoutout to our teammate and new PowerShell MVP Rob Sewell! Rob is one of the most visible members of the SQL PowerShell community, an officer in the PASS PowerShell Virtual Group and an outstanding evangelist & Pester test maker for dbatools. We’re all so excited about Rob’s well-deserved recognition - love you, buddy! ❤️ Bagofbobbish Beta Testing Before the official release of bagofbobbish to master and the PowerShell Gallery, we need help finding bugs.

Read more

The dbatools Team Will Present a Full-Day PASS Summit Precon!

Chrissy LeMaire

Jun 14, 2017

How cool is this? dbatools Major Contributor Constantine Kokkinos and I will be presenting a full-day session at PASS Summit in Seattle, WA, USA on Tuesday, October 31, 2017! Our precon will have a lab so seats are limited — you’ll need to sign up now to ensure a spot. Rob Sewell will also be joining us as a guest presenter and it looks like teammates Sander Stad and Shawn Melton will help proctor the lab 😊

Read more

dbatools - A DevOps Success Story

Chrissy LeMaire

Jun 13, 2017

Updated: Oct 29, 2025

Today’s article is part of T-SQL Tuesday. T-SQL Tuesday is the brainchild of Adam Machanic. It is a blog party on the second Tuesday of each month. Everyone is welcome to participate. This month’s T-SQL Tuesday, hosted by Grant Fritchey (b), is all about Databases and DevOps. What Is DevOps? Recently, I took an Intro to DevOps Engineering class in my Masters program at Regis University. I actually found one of our first assignments to be one of the most challenging: define DevOps.

Read more

VS Code and Task

Shawn Melton

Jun 9, 2017

Updated: Oct 30, 2025

While we are still hard at work getting everything ready for the 1.0 release, thought I would share something I figured out with VS Code. If you are not familiar with VS Code you can check the link out on how it is used to contribute to dbatools. Pester One of the big initiatives we are working fearlessly on for the module is getting the Pester test added and cleaned up.

Read more

New Release - Reverse Giraffe

Chrissy LeMaire

May 4, 2017

Updated: Oct 29, 2025

In the latest release, we gained 8 new commands and 5 new contributors to the dbatools master repository for a grand total of 53! We even added a few new Major Contributors to the team. Thanks to all who have joined in to make the awesomest toolset for SQL Server DBAs — we’re now offering the community nearly 190 quality commands! Export Commands Export-DbaScript Exports scripts from SQL Management Objects.

Read more
Page 4 of 6 (104 total posts)