Deploy SQL-Server-First-Responder-Kit with Powershell
|There are many tools in market that can help you troubleshoot in specific situations. My personal favorite for finding out issue with SQL Server is SQL-Server-First-Responder-Kit created by Brent Ozar Unlimited team.
Now, the problem is if you have hundreds of server to support, copying, pasting, and compiling the procedures provided by SQL-Server-First-Responder-Kit is a tedious task. So, now the kit includes a sql script named ‘Install-All-Procs.sql’ for compiling all procs all together. But, for me, I never intended to use all of the procedures rather only specific ones like sp_Blitz, sp_BlitzFirst, sp_BlitzCache, sp_BlitzIndex, and Adam Mechanic’s sp_whoIsActive. In order to achieve this, I have created a PowerShell module that will help us to compile all the required procedures scripts against any server as per our need just by calling Apply-FirstResponderKit function as below.
If we ever want to read more about Apply-FirstResponderKit function, we can get its details using Get-Help.
Now, we can either import the module explicitly by using Import-Module command like below, or we can place the entire module in any of the directory inside $env:PSModulePath path.
1 |
import-module "C:\FirstResponderKit\FirstResponderKit.psm1" |
PFA the entire FirstResponderKit PowerShell Module as attachment.
Friends, please feel free to connect with me for any query. Also, if you like the scripts, do Like & Share. Happy Coding 🙂