Skip to content

Commit

Permalink
Merge pull request #3230 from BrentOzarULTD/dev
Browse files Browse the repository at this point in the history
2023-02-15 Release
  • Loading branch information
BrentOzar authored Feb 15, 2023
2 parents e10bc83 + b4dce7d commit 9e8f376
Show file tree
Hide file tree
Showing 19 changed files with 3,018 additions and 2,346 deletions.
24 changes: 12 additions & 12 deletions Documentation/Development/Merge Blitz.ps1
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#Set your file path
$FilePath = "C:\temp\SQL-Server-First-Responder-Kit"
$SqlVersionsPath = "$FilePath\SqlServerVersions.sql"
$BlitzFirstPath = "$FilePath\sp_BlitzFirst.sql"
$FilePath = "/Users/brentozar/LocalOnly/Github/SQL-Server-First-Responder-Kit"
$SqlVersionsPath = "$FilePath/SqlServerVersions.sql"
$BlitzFirstPath = "$FilePath/sp_BlitzFirst.sql"

#All Core Blitz Without sp_BlitzQueryStore
Get-ChildItem -Path "$FilePath" -Filter "sp_Blitz*.sql" |
Where-Object { $_.FullName -notlike "*sp_BlitzQueryStore.sql*" -and $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*"} |
ForEach-Object { Get-Content $_.FullName } |
Set-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Force
Set-Content -Path "$FilePath/Install-Core-Blitz-No-Query-Store.sql" -Force
#append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429)
if ( test-path "$SqlVersionsPath")
{ Add-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
{ Add-Content -Path "$FilePath/Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
if ( test-path "$BlitzFirstPath")
{ Add-Content -Path "$FilePath\Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")}
{ Add-Content -Path "$FilePath/Install-Core-Blitz-No-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")}


#All Core Blitz With sp_BlitzQueryStore
Get-ChildItem -Path "$FilePath" -Filter "sp_Blitz*.sql" |
Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*"} |
ForEach-Object { Get-Content $_.FullName } |
Set-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Force
Set-Content -Path "$FilePath/Install-Core-Blitz-With-Query-Store.sql" -Force
#append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429)
if ( test-path "$SqlVersionsPath")
{ Add-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
{ Add-Content -Path "$FilePath/Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
if ( test-path "$BlitzFirstPath")
{ Add-Content -Path "$FilePath\Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")}
{ Add-Content -Path "$FilePath/Install-Core-Blitz-With-Query-Store.sql" -Value (Get-Content -Path "$BlitzFirstPath")}


#All Scripts
Get-ChildItem -Path "$FilePath" -Filter "sp_*.sql" |
Where-Object { $_.FullName -notlike "*sp_BlitzInMemoryOLTP*" -and $_.FullName -notlike "*sp_BlitzFirst*"} |
ForEach-Object { Get-Content $_.FullName } |
Set-Content -Path "$FilePath\Install-All-Scripts.sql" -Force
Set-Content -Path "$FilePath/Install-All-Scripts.sql" -Force
#append script to (re-)create SqlServerVersions Table (https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2429)
if ( test-path "$SqlVersionsPath")
{ Add-Content -Path "$FilePath\Install-All-Scripts.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
{ Add-Content -Path "$FilePath/Install-All-Scripts.sql" -Value (Get-Content -Path "$SqlVersionsPath")}
if ( test-path "$BlitzFirstPath")
{ Add-Content -Path "$FilePath\Install-All-Scripts.sql" -Value (Get-Content -Path "$BlitzFirstPath")}
{ Add-Content -Path "$FilePath/Install-All-Scripts.sql" -Value (Get-Content -Path "$BlitzFirstPath")}
Loading

0 comments on commit 9e8f376

Please sign in to comment.