forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstall-SqlDscBIReportServer.ps1
More file actions
147 lines (111 loc) · 5.39 KB
/
Install-SqlDscBIReportServer.ps1
File metadata and controls
147 lines (111 loc) · 5.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<#
.SYNOPSIS
Installs SQL Server Power BI Report Server.
.DESCRIPTION
Installs SQL Server Power BI Report Server using the provided setup executable.
.PARAMETER AcceptLicensingTerms
Specifies that the acceptance of all license terms and notices for the
specified features is required to be able to run unattended install. By specifying this
parameter you acknowledge the acceptance of all license terms and notices for
the specified features, the terms and notices that the setup executable
normally asks for.
.PARAMETER MediaPath
Specifies the path where to find the SQL Server installation media. On this
path the SQL Server setup executable must be found.
.PARAMETER ProductKey
Specifies the product key to use for the installation, e.g. '12345-12345-12345-12345-12345'.
This parameter is mutually exclusive with the parameter Edition.
.PARAMETER EditionUpgrade
Specifies whether to upgrade the edition of the installed product. Requires that either the
ProductKey or the Edition parameter is also assigned. By default no edition
upgrade is performed.
.PARAMETER Edition
Specifies a free custom edition to use for the installation. This parameter
is mutually exclusive with the parameter ProductKey.
.PARAMETER LogPath
Specifies the file path where to write the log files, e.g. 'C:\Logs\Install.log'.
By default log files are created under %TEMP%.
.PARAMETER InstallFolder
Specifies the folder where to install the product, e.g. 'C:\Program Files\Power BI Report Server'.
By default the product is installed under the default installation folder.
Reporting Services: %ProgramFiles%\Microsoft SQL Server Reporting Services
PI Report Server: %ProgramFiles%\Microsoft Power BI Report Server
.PARAMETER SuppressRestart
Specifies whether to suppress the restart of the computer after the installation is finished.
By default the computer is restarted after the installation is finished.
.PARAMETER Timeout
Specifies how long to wait for the setup process to finish. Default value
is `7200` seconds (2 hours). If the setup process does not finish before
this time, an exception will be thrown.
.PARAMETER Force
Specifies whether the command will not ask for confirmation. Same as if Confirm:$false
is used.
.PARAMETER PassThru
Specifies whether 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'
Installs Power BI Report Server with default settings.
.EXAMPLE
Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -ProductKey '12345-12345-12345-12345-12345'
Installs Power BI Report Server using a product key.
.EXAMPLE
Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' -Edition 'Evaluation' -InstallFolder 'C:\Program Files\Power BI Report Server'
Installs Power BI Report Server in evaluation edition to a custom folder.
.EXAMPLE
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([System.Int32])]
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.SwitchParameter]
$AcceptLicensingTerms,
[Parameter(Mandatory = $true)]
[System.String]
$MediaPath,
[Parameter()]
[System.String]
$ProductKey,
[Parameter()]
[System.Management.Automation.SwitchParameter]
$EditionUpgrade,
[Parameter()]
[ValidateSet('Developer', 'Evaluation', 'ExpressAdvanced')]
[System.String]
$Edition,
[Parameter()]
[System.String]
$LogPath,
[Parameter()]
[System.String]
$InstallFolder,
[Parameter()]
[System.Management.Automation.SwitchParameter]
$SuppressRestart,
[Parameter()]
[System.UInt32]
$Timeout = 7200,
[Parameter()]
[System.Management.Automation.SwitchParameter]
$Force,
[Parameter()]
[System.Management.Automation.SwitchParameter]
$PassThru
)
$exitCode = Invoke-ReportServerSetupAction -Install @PSBoundParameters
if ($PassThru.IsPresent)
{
return $exitCode
}
}