Version 2.0.1

This commit is contained in:
Madzone
2026-08-12 10:22:55 +02:00
parent bef2f08414
commit 9965fdd2ea
4 changed files with 48 additions and 72 deletions
@@ -1,53 +0,0 @@
param(
[Parameter(Mandatory)]
[ValidateSet("VMware", "HyperV", "Proxmox")]
[string]$Platform,
[Parameter(Mandatory)]
[string]$Server,
[PSCredential]$Credential,
[switch]$DryRun
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$Root = $PSScriptRoot
$RequiredModules = @(
"Modules\Veeam\BackupJobs.psm1",
"Modules\Platforms\$Platform.psm1"
)
foreach($Module in $RequiredModules) {
Import-Module (Join-Path $Root $Module) -Force -ErrorAction Stop
}
$Configuration = Get-Content (Join-Path $Root "Config\VeeamConfig.json") -Raw | ConvertFrom-Json
if($Platform -eq "Proxmox" -and $null -eq $Credential) {
$Credential = Get-Credential -Message "Proxmox API-Token-ID und Token-Secret eingeben"
}
switch($Platform) {
"VMware" { $VirtualMachines = @(Get-VMwareInventory -Server $Server) }
"HyperV" { $VirtualMachines = @(Get-HyperVInventory -Server $Server) }
"Proxmox" { $VirtualMachines = @(Get-ProxmoxInventory -Server $Server -ApiCredential $Credential) }
}
$Schedules = New-AlphabeticalBackupSchedules `
-JobName $Configuration.BackupJob.Name `
-VirtualMachines $VirtualMachines `
-ScheduleGroups @($Configuration.BackupJob.ScheduleGroups)
[PSCustomObject]@{
Platform = $Platform
Server = $Server
DryRun = $DryRun.IsPresent
VirtualMachineCount = $VirtualMachines.Count
VirtualMachines = $VirtualMachines
Schedules = $Schedules
JobsCreated = $false
Message = "Inventar gelesen und Zeitplanentwurf erstellt. Es wurden keine Veeam-Jobs angelegt."
}
+24 -1
View File
@@ -13,7 +13,7 @@
- Dry-Run Unterstützung - Dry-Run Unterstützung
.VERSION .VERSION
1.0.2 2.0.1
#> #>
@@ -635,9 +635,20 @@ function Start-VeeamEnterpriseInstall {
$Configuration = Get-InstallerConfiguration $Configuration = Get-InstallerConfiguration
$VeeamAlreadyInstalled = (!$Script:IsDryRun -and (Test-VeeamInstalled))
if($VeeamAlreadyInstalled)
{
Write-Host "Veeam ist bereits installiert. Setup wird übersprungen." -ForegroundColor Green
Write-EnterpriseLog -Level INFO -Message "Vorhandene Veeam-Installation erkannt; Setup wird übersprungen."
$VeeamSourcePath = ""
}
else
{
$VeeamSourcePath = Resolve-VeeamSourcePath ` $VeeamSourcePath = Resolve-VeeamSourcePath `
-SourcePath $VeeamSourcePath ` -SourcePath $VeeamSourcePath `
-ConfiguredPath ([string]$Configuration.Veeam.SourcePath) -ConfiguredPath ([string]$Configuration.Veeam.SourcePath)
}
$Configuration.Repository.Path = Resolve-RepositoryPath ` $Configuration.Repository.Path = Resolve-RepositoryPath `
-Path ([string]$Configuration.Repository.Path) ` -Path ([string]$Configuration.Repository.Path) `
@@ -722,6 +733,17 @@ function Start-VeeamEnterpriseInstall {
-Message ("SQL-Datenbank vorbereitet: {0}; Konto: {1}; Rolle: {2}" -f $SQLPreparation.Database, $SQLPreparation.ServiceAccount, $SQLPreparation.DatabaseRole) -Message ("SQL-Datenbank vorbereitet: {0}; Konto: {1}; Rolle: {2}" -f $SQLPreparation.Database, $SQLPreparation.ServiceAccount, $SQLPreparation.DatabaseRole)
} }
if($VeeamAlreadyInstalled)
{
$Installation = [PSCustomObject]@{
Status = "AlreadyInstalled"
SetupSkipped = $true
InstallationPath = Get-VeeamInstallationPath
Version = Get-VeeamVersion
}
}
else
{
$VeeamAnswerFile = Resolve-VeeamAnswerFile ` $VeeamAnswerFile = Resolve-VeeamAnswerFile `
-AnswerFile $VeeamAnswerFile ` -AnswerFile $VeeamAnswerFile `
-SourcePath $VeeamSourcePath ` -SourcePath $VeeamSourcePath `
@@ -736,6 +758,7 @@ function Start-VeeamEnterpriseInstall {
-Configuration $Configuration ` -Configuration $Configuration `
-SourcePath $VeeamSourcePath ` -SourcePath $VeeamSourcePath `
-AnswerFile $VeeamAnswerFile -AnswerFile $VeeamAnswerFile
}
if($null -eq (Get-Module -ListAvailable -Name "Veeam.Backup.PowerShell")) if($null -eq (Get-Module -ListAvailable -Name "Veeam.Backup.PowerShell"))
+2 -2
View File
@@ -2,7 +2,7 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Module......: Bootstrap.psm1 Module......: Bootstrap.psm1
Projekt.....: Veeam Enterprise Installer Projekt.....: Veeam Enterprise Installer
Version.....: 2.0.0 Version.....: 2.0.1
Autor.......: ChatGPT & Benutzer Autor.......: ChatGPT & Benutzer
PowerShell..: 5.1 PowerShell..: 5.1
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
@@ -29,7 +29,7 @@ Set-StrictMode -Version Latest
#region Script Variablen #region Script Variablen
$Script:ProjectName = "Veeam Enterprise Installer" $Script:ProjectName = "Veeam Enterprise Installer"
$Script:ProjectVersion = "2.0.0" $Script:ProjectVersion = "2.0.1"
$Script:RootPath = $null $Script:RootPath = $null
$Script:ModulePath = $null $Script:ModulePath = $null
+6
View File
@@ -2,6 +2,8 @@
PowerShell-basierter Installer zur automatisierten Installation und Grundkonfiguration von Veeam Backup & Replication auf Windows Server. PowerShell-basierter Installer zur automatisierten Installation und Grundkonfiguration von Veeam Backup & Replication auf Windows Server.
**Projektversion:** 2.0.1
> **Status:** Entwicklung und Test. Vor einem produktiven Einsatz vollständig in einer isolierten Testumgebung prüfen. > **Status:** Entwicklung und Test. Vor einem produktiven Einsatz vollständig in einer isolierten Testumgebung prüfen.
## Funktionen ## Funktionen
@@ -49,6 +51,10 @@ Installation mit automatisch erkanntem Installationsmedium starten:
.\Install-VeeamEnterprise.ps1 .\Install-VeeamEnterprise.ps1
``` ```
Ist Veeam bereits installiert, überspringt das Skript den Setup-Schritt und
setzt die Konfiguration von Repository und Backup-Jobs fort. Dadurch kann der
Lauf nach einem erforderlichen Neustart sicher wieder aufgenommen werden.
Installationsmedium und Antwortdatei können auch explizit angegeben werden: Installationsmedium und Antwortdatei können auch explizit angegeben werden:
```powershell ```powershell