Skip to content

Commit

Permalink
Addresses #394, #409, adding SSRS 2022 vNext support to the SQLServer… (
Browse files Browse the repository at this point in the history
#424)

* Addresses #394, #409, adding SSRS 2022 vNext support to the SQLServerVersion enum

* Fixing copy-paste mistake, sorry

* Change build to run as SQLServer2019 instead of vNext

* Remove vNext as per PR review
  • Loading branch information
mhallockPcty authored Mar 31, 2024
1 parent 95ab7f0 commit ba9226a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
9 changes: 7 additions & 2 deletions ReportingServicesTools/Libraries/library.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ namespace Microsoft.ReportingServicesTools
SQLServer2017 = 14,
/// <summary>
/// SQL Server vNext
/// SQL Server 2019
/// </summary>
SQLServervNext = 15
SQLServer2019 = 15,
/// <summary>
/// SQL Server 2022
/// </summary>
SQLServer2022 = 16
}
}
"@
Expand Down
12 changes: 6 additions & 6 deletions Tests/Admin/Set-RsDatabase.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function Get-DatabaseName() {
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019
return $wmiObject.DatabaseName
}

function Get-CredentialType() {
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019
switch ($wmiObject.DatabaseLogonType) {
0 { return 'Windows' }
1 { return 'SQL' }
Expand All @@ -26,7 +26,7 @@ Describe "Set-RsDatabase" {
$databaseServerName = 'localhost'
$databaseName = 'ReportServer' + [System.DateTime]::Now.Ticks
$credentialType = 'ServiceAccount'
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update database and credentials" {
Get-DatabaseName | Should be $databaseName
Expand All @@ -39,7 +39,7 @@ Describe "Set-RsDatabase" {
$databaseName = 'ReportServer' + [System.DateTime]::Now.Ticks
$credentialType = 'SQL'
$credential = Get-SaCredentials
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -DatabaseCredential $credential -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -DatabaseCredential $credential -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update database and credentials" {
Get-DatabaseName | Should be $databaseName
Expand All @@ -52,7 +52,7 @@ Describe "Set-RsDatabase" {
$databaseName = 'ReportServer'
$credentialType = 'SQL'
$credential = Get-SaCredentials
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -DatabaseCredential $credential -IsExistingDatabase -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -DatabaseCredential $credential -IsExistingDatabase -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update database and credentials" {
Get-DatabaseName | Should be $databaseName
Expand All @@ -64,7 +64,7 @@ Describe "Set-RsDatabase" {
$databaseServerName = 'localhost'
$databaseName = 'ReportServer'
$credentialType = 'ServiceAccount'
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -IsExistingDatabase -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabase -DatabaseServerName $databaseServerName -DatabaseName $databaseName -DatabaseCredentialType $credentialType -IsExistingDatabase -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update database and credentials" {
Get-DatabaseName | Should be $databaseName
Expand Down
6 changes: 3 additions & 3 deletions Tests/Admin/Set-RsDatabaseCredentials.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Get-CredentialType() {
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
$wmiObject = New-RsConfigurationSettingObject -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019
switch ($wmiObject.DatabaseLogonType) {
0 { return 'Windows' }
1 { return 'SQL' }
Expand All @@ -20,7 +20,7 @@ Describe "Set-RsDatabaseCredentials" {
Context "Changing database credential type to ServiceAccount credentials" {
$credentialType = 'SQL'
$credential = Get-SaCredentials
Set-RsDatabaseCredentials -DatabaseCredentialType $credentialType -DatabaseCredential $credential -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabaseCredentials -DatabaseCredentialType $credentialType -DatabaseCredential $credential -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update credentials" {
Get-CredentialType | Should be $credentialType
Expand All @@ -29,7 +29,7 @@ Describe "Set-RsDatabaseCredentials" {

Context "Changing database credential type to SQL credentials" {
$credentialType = 'ServiceAccount'
Set-RsDatabaseCredentials -DatabaseCredentialType $credentialType -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
Set-RsDatabaseCredentials -DatabaseCredentialType $credentialType -Confirm:$false -Verbose -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019

It "Should update credentials" {
Get-CredentialType | Should be $credentialType
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ before_test:
Import-Module .\ReportingServicesTools\ReportingServicesTools.psd1
Write-Host "Configuring PBI RS" (Get-Date).DateTime
Set-RsDatabase -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext -DatabaseServerName localhost -DatabaseName ReportServer -DatabaseCredentialType ServiceAccount -Confirm:$false
Set-PbiRsUrlReservation -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext
try {Initialize-Rs -ReportServerInstance PBIRS -ReportServerVersion SQLServervNext} catch {}
Set-RsDatabase -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019 -DatabaseServerName localhost -DatabaseName ReportServer -DatabaseCredentialType ServiceAccount -Confirm:$false
Set-PbiRsUrlReservation -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019
try {Initialize-Rs -ReportServerInstance PBIRS -ReportServerVersion SQLServer2019} catch {}
Stop-Service PowerBIReportServer
Start-Service PowerBIReportServer
Start-Service SQLSERVERAGENT
Expand Down

0 comments on commit ba9226a

Please sign in to comment.