|
| 1 | +<# |
| 2 | + .SYNOPSIS |
| 3 | + Installs SQL Server Reporting Services or Power BI Report Server. |
| 4 | +
|
| 5 | + .DESCRIPTION |
| 6 | + Installs SQL Server Reporting Services or Power BI Report Server using |
| 7 | + the provided setup executable. |
| 8 | +
|
| 9 | + .PARAMETER AcceptLicensingTerms |
| 10 | + Required parameter to be able to run unattended install. By specifying this |
| 11 | + parameter you acknowledge the acceptance of all license terms and notices for |
| 12 | + the specified features, the terms and notices that the setup executable |
| 13 | + normally asks for. |
| 14 | +
|
| 15 | + .PARAMETER MediaPath |
| 16 | + Specifies the path where to find the SQL Server installation media. On this |
| 17 | + path the SQL Server setup executable must be found. |
| 18 | +
|
| 19 | + .PARAMETER ProductKey |
| 20 | + Specifies the product key to use for the installation, e.g. '12345-12345-12345-12345-12345'. |
| 21 | + This parameter is mutually exclusive with the parameter Edition. |
| 22 | +
|
| 23 | + .PARAMETER EditionUpgrade |
| 24 | + Upgrades the edition of the installed product. Requires that either the |
| 25 | + ProductKey or the Edition parameter is also assigned. By default no edition |
| 26 | + upgrade is performed. |
| 27 | +
|
| 28 | + .PARAMETER Edition |
| 29 | + Specifies a free custom edition to use for the installation. This parameter |
| 30 | + is mutually exclusive with the parameter ProductKey. |
| 31 | +
|
| 32 | + .PARAMETER LogPath |
| 33 | + Specifies the file path where to write the log files, e.g. 'C:\Logs\Install.log'. |
| 34 | + By default log files are created under %TEMP%. |
| 35 | +
|
| 36 | + .PARAMETER InstallFolder |
| 37 | + Specifies the folder where to install the product, e.g. 'C:\Program Files\SSRS'. |
| 38 | + By default the product is installed under the default installation folder. |
| 39 | +
|
| 40 | + Reporting Services: %ProgramFiles%\Microsoft SQL Server Reporting Services |
| 41 | + PI Report Server: %ProgramFiles%\Microsoft Power BI Report Server |
| 42 | +
|
| 43 | + .PARAMETER SuppressRestart |
| 44 | + Suppresses the restart of the computer after the installation is finished. |
| 45 | + By default the computer is restarted after the installation is finished. |
| 46 | +
|
| 47 | + .PARAMETER Timeout |
| 48 | + Specifies how long to wait for the setup process to finish. Default value |
| 49 | + is `7200` seconds (2 hours). If the setup process does not finish before |
| 50 | + this time, an exception will be thrown. |
| 51 | +
|
| 52 | + .PARAMETER Force |
| 53 | + If specified the command will not ask for confirmation. Same as if Confirm:$false |
| 54 | + is used. |
| 55 | +
|
| 56 | + .EXAMPLE |
| 57 | + Install-SqlDscReportingServices -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' |
| 58 | +
|
| 59 | + Installs SQL Server Reporting Services with default settings. |
| 60 | +
|
| 61 | + .EXAMPLE |
| 62 | + Install-SqlDscReportingServices -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' -ProductKey '12345-12345-12345-12345-12345' |
| 63 | +
|
| 64 | + Installs SQL Server Reporting Services using a product key. |
| 65 | +
|
| 66 | + .EXAMPLE |
| 67 | + Install-SqlDscReportingServices -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -Edition 'Evaluation' -InstallFolder 'C:\Program Files\Power BI Report Server' |
| 68 | +
|
| 69 | + Installs Power BI Report Server in evaluation edition to a custom folder. |
| 70 | +
|
| 71 | + .EXAMPLE |
| 72 | + Install-SqlDscReportingServices -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' -ProductKey '12345-12345-12345-12345-12345' -EditionUpgrade -LogPath 'C:\Logs\SSRS_Install.log' |
| 73 | +
|
| 74 | + Installs SQL Server Reporting Services and upgrades the edition using a |
| 75 | + product key. Also specifies a custom log path. |
| 76 | +#> |
| 77 | +function Install-SqlDscReportingServices |
| 78 | +{ |
| 79 | + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')] |
| 80 | + [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] |
| 81 | + [OutputType()] |
| 82 | + param |
| 83 | + ( |
| 84 | + [Parameter(Mandatory = $true)] |
| 85 | + [System.Management.Automation.SwitchParameter] |
| 86 | + $AcceptLicensingTerms, |
| 87 | + |
| 88 | + [Parameter(Mandatory = $true)] |
| 89 | + [System.String] |
| 90 | + $MediaPath, |
| 91 | + |
| 92 | + [Parameter()] |
| 93 | + [System.String] |
| 94 | + $ProductKey, |
| 95 | + |
| 96 | + [Parameter()] |
| 97 | + [System.Management.Automation.SwitchParameter] |
| 98 | + $EditionUpgrade, |
| 99 | + |
| 100 | + [Parameter()] |
| 101 | + [ValidateSet('Development', 'Evaluation', 'ExpressAdvanced')] |
| 102 | + [System.String] |
| 103 | + $Edition, |
| 104 | + |
| 105 | + [Parameter()] |
| 106 | + [System.String] |
| 107 | + $LogPath, |
| 108 | + |
| 109 | + [Parameter()] |
| 110 | + [System.String] |
| 111 | + $InstallFolder, |
| 112 | + |
| 113 | + [Parameter()] |
| 114 | + [System.Management.Automation.SwitchParameter] |
| 115 | + $SuppressRestart, |
| 116 | + |
| 117 | + [Parameter()] |
| 118 | + [System.UInt32] |
| 119 | + $Timeout = 7200, |
| 120 | + |
| 121 | + [Parameter()] |
| 122 | + [System.Management.Automation.SwitchParameter] |
| 123 | + $Force |
| 124 | + ) |
| 125 | + |
| 126 | + Invoke-ReportServerSetupAction -Install @PSBoundParameters |
| 127 | +} |
0 commit comments