Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add additional properties to `Get-SqlDscRSSetupConfiguration` output.
- `Install-SqlDscReportingService` to install SQL Server Reporting Services
([issue #2010](https://github.com/dsccommunity/SqlServerDsc/issues/2010)).
- Add `PassThru` parameter to return exit code.
- `Install-SqlDscBIReportServer` to install SQL Server BI Report Server.
([issue #2010](https://github.com/dsccommunity/SqlServerDsc/issues/2010)).
- Add `PassThru` parameter to return exit code.
- `Repair-SqlDscReportingService` to repair an already installed SQL Server
Reporting Services ([issue #2064](https://github.com/dsccommunity/SqlServerDsc/issues/2064)).
- Add `PassThru` parameter to return exit code.
- `Repair-SqlDscBIReportServer` to repair an already installed SQL Server
BI Report Server ([issue #2064](https://github.com/dsccommunity/SqlServerDsc/issues/2064)).
- Add `PassThru` parameter to return exit code.
- `Test-SqlDscRSInstalled` to test whether an instance is installed or not
([issue #2078](https://github.com/dsccommunity/SqlServerDsc/issues/2078)).
- `Uninstall-SqlDscReportingService` to uninstall SQL Server Reporting
Services ([issue #2065](https://github.com/dsccommunity/SqlServerDsc/issues/2065)).
- Add `PassThru` parameter to return exit code.
- `Uninstall-SqlDscBIReportServer` to uninstall SQL Server BI Report Server
([issue #2065](https://github.com/dsccommunity/SqlServerDsc/issues/2065)).
- Add `PassThru` parameter to return exit code.
- Private function:
- `Invoke-ReportServerSetupAction` to run setup actions for Reporting
Services and Power BI Report Server.
Expand Down
24 changes: 21 additions & 3 deletions source/Private/Invoke-ReportServerSetupAction.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.LINK
https://learn.microsoft.com/en-us/power-bi/report-server/install-report-server
https://learn.microsoft.com/en-us/sql/reporting-services/install-windows/install-reporting-services

.OUTPUTS
None.
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Invoke-ReportServerSetupAction -Install -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe'
Expand Down Expand Up @@ -99,11 +103,16 @@
Invoke-ReportServerSetupAction -Uninstall -MediaPath 'E:\SQLServerReportingServices.exe' -Force

Uninstalls SQL Server Reporting Services without prompting for confirmation.

.EXAMPLE
$exitCode = Invoke-ReportServerSetupAction -Install -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' -PassThru

Installs SQL Server Reporting Services and returns the setup process exit code.
#>
function Invoke-ReportServerSetupAction
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(ParameterSetName = 'Install', Mandatory = $true)]
Expand Down Expand Up @@ -180,7 +189,11 @@ function Invoke-ReportServerSetupAction

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

if ($Force.IsPresent -and -not $Confirm)
Expand Down Expand Up @@ -328,5 +341,10 @@ function Invoke-ReportServerSetupAction
'{0} {1}' -f $setupExitMessage, ($script:localizedData.SetupAction_SetupSuccessful)
)
}

if ($PassThru.IsPresent)
{
return $processExitCode
}
}
}
27 changes: 24 additions & 3 deletions source/Public/Install-SqlDscBIReportServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.OUTPUTS
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe'

Expand All @@ -71,12 +78,17 @@
Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -ProductKey '12345-12345-12345-12345-12345' -EditionUpgrade -LogPath 'C:\Logs\PowerBIReportServer_Install.log'

Installs Power BI Report Server and upgrades the edition using a product key. Also specifies a custom log path.

.EXAMPLE
$exitCode = Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -PassThru

Installs Power BI Report Server with default settings and returns the setup exit code.
#>
function Install-SqlDscBIReportServer
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -118,8 +130,17 @@ function Install-SqlDscBIReportServer

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

Invoke-ReportServerSetupAction -Install @PSBoundParameters
$exitCode = Invoke-ReportServerSetupAction -Install @PSBoundParameters

if ($PassThru.IsPresent)
{
return $exitCode
}
}
27 changes: 24 additions & 3 deletions source/Public/Install-SqlDscReportingService.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.OUTPUTS
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Install-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe'

Expand All @@ -73,12 +80,17 @@

Installs SQL Server Reporting Services and upgrades the edition using a
product key. Also specifies a custom log path.

.EXAMPLE
$exitCode = Install-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' -PassThru

Installs SQL Server Reporting Services with default settings and returns the setup exit code.
#>
function Install-SqlDscReportingService
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -120,8 +132,17 @@ function Install-SqlDscReportingService

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

Invoke-ReportServerSetupAction -Install @PSBoundParameters
$exitCode = Invoke-ReportServerSetupAction -Install @PSBoundParameters

if ($PassThru.IsPresent)
{
return $exitCode
}
}
27 changes: 24 additions & 3 deletions source/Public/Repair-SqlDscBIReportServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.OUTPUTS
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Repair-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe'

Expand All @@ -67,12 +74,17 @@
Repair-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -LogPath 'C:\Logs\PowerBIReportServer_Repair.log'

Repairs Power BI Report Server and specifies a custom log path.

.EXAMPLE
$exitCode = Repair-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -PassThru

Repairs Power BI Report Server with default settings and returns the setup exit code.
#>
function Repair-SqlDscBIReportServer
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -114,8 +126,17 @@ function Repair-SqlDscBIReportServer

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

Invoke-ReportServerSetupAction -Repair @PSBoundParameters
$exitCode = Invoke-ReportServerSetupAction -Repair @PSBoundParameters

if ($PassThru.IsPresent)
{
return $exitCode
}
}
27 changes: 24 additions & 3 deletions source/Public/Repair-SqlDscReportingService.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.OUTPUTS
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Repair-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe'

Expand All @@ -69,12 +76,17 @@
Repair-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -LogPath 'C:\Logs\PowerBIReportServer_Repair.log'

Repairs Power BI Report Server and specifies a custom log path.

.EXAMPLE
$exitCode = Repair-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' -PassThru

Repairs SQL Server Reporting Services with default settings and returns the setup exit code.
#>
function Repair-SqlDscReportingService
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
Expand Down Expand Up @@ -116,8 +128,17 @@ function Repair-SqlDscReportingService

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

Invoke-ReportServerSetupAction -Repair @PSBoundParameters
$exitCode = Invoke-ReportServerSetupAction -Repair @PSBoundParameters

if ($PassThru.IsPresent)
{
return $exitCode
}
}
27 changes: 24 additions & 3 deletions source/Public/Uninstall-SqlDscBIReportServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
If specified the command will not ask for confirmation. Same as if Confirm:$false
is used.

.PARAMETER PassThru
If specified the command will return the setup process exit code.

.OUTPUTS
When PassThru is specified the function will return the setup process exit
code as System.Int32. Otherwise, the function does not generate any output.

.EXAMPLE
Uninstall-SqlDscBIReportServer -MediaPath 'E:\PowerBIReportServer.exe'

Expand All @@ -40,12 +47,17 @@
Uninstall-SqlDscBIReportServer -MediaPath 'E:\PowerBIReportServer.exe' -Force

Uninstalls Power BI Report Server without prompting for confirmation.

.EXAMPLE
$exitCode = Uninstall-SqlDscBIReportServer -MediaPath 'E:\PowerBIReportServer.exe' -PassThru

Uninstalls Power BI Report Server and returns the setup exit code.
#>
function Uninstall-SqlDscBIReportServer
{
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[OutputType()]
[OutputType([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
Expand All @@ -66,8 +78,17 @@ function Uninstall-SqlDscBIReportServer

[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force
$Force,

[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)

Invoke-ReportServerSetupAction -Uninstall @PSBoundParameters
$exitCode = Invoke-ReportServerSetupAction -Uninstall @PSBoundParameters

if ($PassThru.IsPresent)
{
return $exitCode
}
}
Loading