|
1 | 1 | #Set your file path |
2 | 2 | $FilePath = "C:\temp\SQL-Server-First-Responder-Kit" |
3 | 3 | $SqlVersionsPath = "$FilePath\SqlServerVersions.sql" |
| 4 | +$BlitzFirstPath = "$FilePath\sp_BlitzFirst.sql" |
4 | 5 |
|
5 | 6 | #All Core Blitz Without sp_BlitzQueryStore |
6 | 7 | Get-ChildItem -Path "$FilePath" -Filter "sp_Blitz*.sql" | |
7 | | -Where-Object { $_.FullName -notlike "*sp_BlitzQueryStore.sql*" -and $_.FullName -notlike "*sp_BlitzInMemoryOLTP*"} | |
| 8 | +Where-Object { $_.FullName -notlike "*sp_BlitzQueryStore.sql*" -and $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*" -and $_.FullName -notlike "*sp_BlitzAnalysis*"} | |
8 | 9 | ForEach-Object { Get-Content $_.FullName } | |
9 | 10 | Set-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Force |
10 | 11 | #append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429) |
11 | 12 | if ( test-path "$SqlVersionsPath") |
12 | 13 | { Add-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")} |
| 14 | +if ( test-path "$BlitzFirstPath") |
| 15 | + { Add-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")} |
13 | 16 |
|
14 | 17 |
|
15 | 18 | #All Core Blitz With sp_BlitzQueryStore |
16 | 19 | Get-ChildItem -Path "$FilePath" -Filter "sp_Blitz*.sql" | |
17 | | -Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*"} | |
| 20 | +Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*" -and $_.FullName -notlike "*sp_BlitzAnalysis*"} | |
18 | 21 | ForEach-Object { Get-Content $_.FullName } | |
19 | 22 | Set-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Force |
20 | 23 | #append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429) |
21 | 24 | if ( test-path "$SqlVersionsPath") |
22 | 25 | { Add-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")} |
| 26 | +if ( test-path "$BlitzFirstPath") |
| 27 | + { Add-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")} |
23 | 28 |
|
24 | 29 |
|
25 | 30 | #All Scripts |
26 | 31 | Get-ChildItem -Path "$FilePath" -Filter "sp_*.sql" | |
27 | | -Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*"} | |
| 32 | +Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*" -and $_.FullName -notlike "*sp_BlitzAnalysis*"} | |
28 | 33 | ForEach-Object { Get-Content $_.FullName } | |
29 | 34 | Set-Content -Path "$FilePath\Install-All-Scripts.sql" -Force |
30 | 35 | #append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429) |
31 | 36 | if ( test-path "$SqlVersionsPath") |
32 | 37 | { Add-Content -Path "$FilePath\Install-All-Scripts.sql" -Value (Get-Content -Path "$SqlVersionsPath")} |
| 38 | +if ( test-path "$BlitzFirstPath") |
| 39 | + { Add-Content -Path "$FilePath\Install-All-Scripts.sql" -Value (Get-Content -Path "$BlitzFirstPath")} |
0 commit comments