Skip to content

Commit 13a743f

Browse files
authored
Merge pull request BrentOzarULTD#3954 from BrentOzarULTD/install-azure-add-blitz
Install-Azure.sql: include sp_Blitz and sp_ineachdb
2 parents e6f4272 + 1bc870e commit 13a743f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

Documentation/Development/Build Installation Scripts.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,17 @@ $InstallAllPath = Join-Path $RepoRoot "Install-All-Scripts.sql"
138138
$InstallAzurePath = Join-Path $RepoRoot "Install-Azure.sql"
139139

140140
# ── Install-Azure.sql ────────────────────────────────────────────────────────
141-
# All sp_Blitz*.sql except sp_Blitz.sql, sp_BlitzBackups.sql, sp_DatabaseRestore.sql, sp_BlitzFirst.sql
142-
$azureContent = Get-ChildItem -Path $RepoRoot -Filter "sp_Blitz*.sql" |
143-
Where-Object { $_.Name -ne "sp_Blitz.sql" -and $_.Name -notlike "*BlitzBackups*" -and $_.Name -notlike "*DatabaseRestore*" -and $_.Name -notlike "*BlitzFirst*" } |
141+
# sp_ineachdb.sql must come first because sp_Blitz calls it at runtime.
142+
# All sp_Blitz*.sql except sp_BlitzBackups.sql, sp_DatabaseRestore.sql, sp_BlitzFirst.sql.
143+
# sp_BlitzBackups and sp_DatabaseRestore depend on xp_cmdshell / msdb backup history.
144+
# sp_BlitzFirst is appended last (same as Install-All-Scripts.sql).
145+
$IneachdbPath = Join-Path $RepoRoot "sp_ineachdb.sql"
146+
$azureContent = @()
147+
if (Test-Path $IneachdbPath) {
148+
$azureContent += Get-Content -Path $IneachdbPath -Raw -Encoding UTF8
149+
}
150+
$azureContent += Get-ChildItem -Path $RepoRoot -Filter "sp_Blitz*.sql" |
151+
Where-Object { $_.Name -notlike "*BlitzBackups*" -and $_.Name -notlike "*DatabaseRestore*" -and $_.Name -notlike "*BlitzFirst*" } |
144152
ForEach-Object { Get-Content $_.FullName -Raw -Encoding UTF8 }
145153

146154
if (Test-Path $BlitzFirstPath) {

0 commit comments

Comments
 (0)