Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Install-VBRServer
- {
- param (
- [Parameter(Mandatory=$True)]
- [string]$Path,
- [string]$SQLServer,
- [switch]$SQLAuth,
- [string]$Username,
- [string]$Password,
- [string]$Licence
- )
- Write-Host "Installing VBRServer..."
- $SQLAuthParam = $null
- if ($SQLServer)
- {
- $SQLServer = ('VBR_SQLSERVER_SERVER="' + $SQLServer + '"')
- }
- if ($SQLAuth)
- {
- $SQLAuthParam = 'VBR_SQLSERVER_AUTHENTICATION="1"'
- }
- if ($Username)
- {
- $Username = ('VBR_SQLSERVER_USERNAME="'+ $Username +'"')
- }
- if ($Password)
- {
- $Password = ('VBR_SQLSERVER_PASSWORD="' + $Password + '"' )
- }
- $VBRMsiPath =(Join-Path -Path $Path -ChildPath "Backup\Server.x64.msi")
- $Logpath = New-InstallationLogsFolder
- if ($Licence)
- {
- $LocalLicencePath = Join-Path -Path $Logpath -ChildPath "Licence.lic"
- Copy-Item -Path $Licence -Destination $LocalLicencePath
- $Licence = ('VBR_LICENSE_FILE="' + $LocalLicencePath + '"')
- }
- & msiexec /L*v $Logpath\VBRServer.log /qn /i $VBRMsiPath ACCEPTEULA="YES" $SQLServer $SQLAuthParam $Username $Password $Licence | Out-Null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement