Skip to content

Commit a00a794

Browse files
authored
Install-DbaDarlingData: Added new stored procedures, documented abbreviations, and gave every procedure an abbreviation (#9652)
1 parent 8315ec2 commit a00a794

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

public/Install-DbaDarlingData.ps1

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Install-DbaDarlingData {
44
Installs or updates Erik Darling's stored procedures.
55
66
.DESCRIPTION
7-
Downloads, extracts and installs Erik Darling's stored procedures
7+
Downloads, extracts and installs Erik Darling's stored procedures. It does not install anything else from the repository. For example, the WhatsUpMemory view is not installed.
88
99
DarlingData links:
1010
https://www.erikdarling.com
@@ -32,10 +32,16 @@ function Install-DbaDarlingData {
3232
.PARAMETER Procedure
3333
Specifies the name(s) of the procedures to install
3434
Allowed Values or Combination of Values:
35-
All (default, to install all 3 procedures)
36-
Human (to install sp_HumanEvents)
37-
Pressure (to install sp_PressureDetector)
38-
Quickie (to install sp_QuickieStore)
35+
All (default, to install all procedures)
36+
HumanEvents (to install sp_HumanEvents)
37+
PressureDetector (to install sp_PressureDetector)
38+
QuickieStore (to install sp_QuickieStore)
39+
HumanEventsBlockViewer (to install sp_HumanEventsBlockViewer)
40+
LogHunter (to install sp_LogHunter)
41+
HealthParser (to install sp_HealthParser)
42+
IndexCleanup (to install sp_IndexCleanup)
43+
PerfCheck (to install sp_PerfCheck)
44+
The following shorthands are allowed, ordered as above: Human, Pressure, Quickie, Block, Log, Health, Index, Perf.
3945
4046
.PARAMETER LocalFile
4147
Specifies the path to a local file to install from. This *should* be the zip file as distributed by the maintainers.
@@ -74,7 +80,7 @@ function Install-DbaDarlingData {
7480
.EXAMPLE
7581
PS C:\> Install-DbaDarlingData -SqlInstance server1\instance1 -Database DBA
7682
77-
Logs into server1\instance1 with Windows authentication and then installs tall of Erik's scripts in the DBA database.
83+
Logs into server1\instance1 with Windows authentication and then installs all of Erik's scripts in the DBA database.
7884
7985
.EXAMPLE
8086
PS C:\> Install-DbaDarlingData -SqlInstance server1\instance1 -Database master -SqlCredential $cred
@@ -104,7 +110,7 @@ function Install-DbaDarlingData {
104110
[object]$Database = "master",
105111
[ValidateSet('main', 'dev')]
106112
[string]$Branch = "main",
107-
[ValidateSet('All', 'Human', 'Pressure', 'Quickie', 'HumanEvents', 'PressureDetector', 'QuickieStore', 'HumanEventsBlockViewer', 'LogHunter', 'HealthParser')]
113+
[ValidateSet('All', 'Human', 'HumanEvents', 'Pressure', 'PressureDetector', 'Quickie', 'QuickieStore', 'Block', 'HumanEventsBlockViewer', 'Log', 'LogHunter', 'Health', 'HealthParser', 'Index', 'IndexCleanup', 'Perf', 'PerfCheck')]
108114
[string[]]$Procedure = "All",
109115
[string]$LocalFile,
110116
[switch]$Force,
@@ -164,15 +170,21 @@ function Install-DbaDarlingData {
164170
if ($Procedure -contains "Quickie" -or $Procedure -contains "QuickieStore") {
165171
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_QuickieStore.sql" -Recurse
166172
}
167-
if ($Procedure -contains "HumanEventsBlockViewer") {
173+
if ($Procedure -contains "Block" -or $Procedure -contains "HumanEventsBlockViewer") {
168174
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_HumanEventsBlockViewer.sql" -Recurse
169175
}
170-
if ($Procedure -contains "LogHunter") {
176+
if ($Procedure -contains "Log" -or $Procedure -contains "LogHunter") {
171177
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_LogHunter.sql" -Recurse
172178
}
173-
if ($Procedure -contains "HealthParser") {
179+
if ($Procedure -contains "Health" -or $Procedure -contains "HealthParser") {
174180
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_HealthParser.sql" -Recurse
175181
}
182+
if ($Procedure -contains "Index" -or $Procedure -contains "IndexCleanup") {
183+
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_IndexCleanup.sql" -Recurse
184+
}
185+
if ($Procedure -contains "Perf" -or $Procedure -contains "PerfCheck") {
186+
$sqlScripts += Get-ChildItem $localCachedCopy -Filter "sp_PerfCheck.sql" -Recurse
187+
}
176188
}
177189

178190
foreach ($script in $sqlScripts) {
@@ -219,4 +231,4 @@ function Install-DbaDarlingData {
219231
Write-Message -Level Verbose -Message "Finished installing/updating the DarlingData stored procedures in $database on $instance."
220232
}
221233
}
222-
}
234+
}

0 commit comments

Comments
 (0)