Published: • 2 min read

Installing dbatools

I write a lot about SQL Server automation, and dbatools comes up constantly. Instead of rewriting the install steps in every post, I’m putting them here once so I can just point back.

The full instructions live on the official site: dbatools.io/download. If you’re new to dbatools, follow those first, they’re always up to date. You should also check out their Getting Started page: dbatools.io/getting-started while you’re there since it has tons of great examples to give you ideas for your next automation project.

The gist is simple though. From an admin PowerShell session:

Install-Module dbatools -Scope CurrentUser

If you’re prompted about trusting the repository, say yes… it’s the official source. On older systems you may also need to explicitly trust PSGallery with:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Check that it worked:

Get-Command -Module dbatools

Keep it updated periodically with this command:

Update-Module dbatools

Note: If you run into errors about script execution policy, you may need to allow PowerShell to run downloaded modules. The simplest way is:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

That lets you run modules you install from the Gallery while still keeping protections in place.

That’s really all you need for most modern cases. For older versions of Windows or locked-down environments, see the alternate installation methods listed on the official download page.