Thor Logo dbatools

Party

I ❤ Invoke-DbaQuery

Pétur Grétarsson

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

Cleaning Up Comment-Based Help

Andy Levy

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

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

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

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

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

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

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

Scheduling PowerShell Tasks with SQL Agent

Chrissy LeMaire

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

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

Chrissy LeMaire

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
Page 3 of 4