Version 2.1.0
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
- Dry-Run Unterstützung
|
||||
|
||||
.VERSION
|
||||
2.0.1
|
||||
2.1.0
|
||||
#>
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ $Script:InstallerRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
$Script:ModulePath = Join-Path $Script:InstallerRoot "Modules"
|
||||
$Script:ConfigPath = Join-Path (Join-Path $Script:InstallerRoot "Config") "VeeamConfig.json"
|
||||
$Script:LicensePath = Join-Path $Script:InstallerRoot "Lizenz"
|
||||
|
||||
############################################################
|
||||
# Import Installer Module
|
||||
@@ -425,6 +426,36 @@ function Install-VeeamProduct {
|
||||
}
|
||||
|
||||
|
||||
############################################################
|
||||
# Veeam Lizenz auswählen
|
||||
############################################################
|
||||
|
||||
function Get-LocalVeeamLicense {
|
||||
if(!(Test-Path -LiteralPath $Script:LicensePath -PathType Container)) {
|
||||
New-Item -Path $Script:LicensePath -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
|
||||
$LicenseFiles = @(
|
||||
Get-ChildItem -LiteralPath $Script:LicensePath -File -Filter "*.lic" -ErrorAction Stop
|
||||
)
|
||||
|
||||
if($LicenseFiles.Count -gt 1) {
|
||||
throw "Im Ordner '$Script:LicensePath' wurden mehrere .lic-Dateien gefunden. Es darf genau eine Veeam-Lizenzdatei vorhanden sein."
|
||||
}
|
||||
|
||||
if($LicenseFiles.Count -eq 1) {
|
||||
$LicenseFile = $LicenseFiles[0].FullName
|
||||
Write-Host "Veeam-Lizenzdatei gefunden: $($LicenseFiles[0].Name)" -ForegroundColor Green
|
||||
Write-EnterpriseLog -Level INFO -Message ("Veeam-Lizenzdatei gefunden: {0}" -f $LicenseFiles[0].Name)
|
||||
return $LicenseFile
|
||||
}
|
||||
|
||||
Write-Host "Keine Lizenzdatei gefunden. Community Edition wird verwendet." -ForegroundColor Yellow
|
||||
Write-EnterpriseLog -Level INFO -Message "Keine Veeam-Lizenzdatei gefunden; Community Edition wird verwendet."
|
||||
return $null
|
||||
}
|
||||
|
||||
|
||||
|
||||
############################################################
|
||||
# Repository Initialisierung
|
||||
@@ -634,6 +665,7 @@ function Start-VeeamEnterpriseInstall {
|
||||
|
||||
|
||||
$Configuration = Get-InstallerConfiguration
|
||||
$VeeamLicenseFile = Get-LocalVeeamLicense
|
||||
|
||||
$VeeamAlreadyInstalled = (!$Script:IsDryRun -and (Test-VeeamInstalled))
|
||||
|
||||
@@ -751,7 +783,8 @@ function Start-VeeamEnterpriseInstall {
|
||||
-DatabaseEngine $Configuration.SQL.Engine `
|
||||
-SQLServer $Configuration.SQL.Server `
|
||||
-SQLInstance $Configuration.SQL.Instance `
|
||||
-DatabaseName $Configuration.SQL.Database
|
||||
-DatabaseName $Configuration.SQL.Database `
|
||||
-LicenseFile $VeeamLicenseFile
|
||||
|
||||
$Installation =
|
||||
Install-VeeamProduct `
|
||||
@@ -768,6 +801,17 @@ function Start-VeeamEnterpriseInstall {
|
||||
|
||||
Import-Module "Veeam.Backup.PowerShell" -Force -ErrorAction Stop
|
||||
|
||||
if($VeeamAlreadyInstalled -and ![string]::IsNullOrWhiteSpace($VeeamLicenseFile))
|
||||
{
|
||||
if($null -eq (Get-Command Install-VBRLicense -ErrorAction SilentlyContinue))
|
||||
{
|
||||
throw "Install-VBRLicense ist nicht verfügbar. Die gefundene Veeam-Lizenz konnte nicht installiert werden."
|
||||
}
|
||||
|
||||
Install-VBRLicense -Path $VeeamLicenseFile -Force -ErrorAction Stop
|
||||
Write-EnterpriseLog -Level INFO -Message "Veeam-Lizenz wurde auf der vorhandenen Installation eingespielt."
|
||||
}
|
||||
|
||||
|
||||
$Repository =
|
||||
Initialize-BackupRepository `
|
||||
|
||||
Reference in New Issue
Block a user