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