Version 1.0 of Configure
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
param(
|
||||
[ValidateSet("DryRun", "Production")]
|
||||
[string]$Mode = "DryRun"
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ConfigureScript = Join-Path $PSScriptRoot "Configure-VeeamEnvironment.ps1"
|
||||
|
||||
if(!$PSBoundParameters.ContainsKey("Mode")) {
|
||||
Write-Host ""
|
||||
Write-Host "Veeam Configure Startmenü" -ForegroundColor Cyan
|
||||
Write-Host "1 - Dry-Run (Standard und empfohlen)"
|
||||
Write-Host "2 - Produktiv"
|
||||
|
||||
$Selection = Read-Host "Modus auswählen [1]"
|
||||
if([string]::IsNullOrWhiteSpace($Selection) -or $Selection -eq "1") {
|
||||
$Mode = "DryRun"
|
||||
}
|
||||
elseif($Selection -eq "2") {
|
||||
$Mode = "Production"
|
||||
}
|
||||
else {
|
||||
throw "Ungültige Auswahl: $Selection"
|
||||
}
|
||||
}
|
||||
|
||||
if($Mode -eq "Production") {
|
||||
Write-Host ""
|
||||
Write-Warning "Produktivmodus kann Änderungen an der Veeam-Umgebung durchführen."
|
||||
$Confirmation = Read-Host "Zum Fortfahren exakt PRODUKTIV eingeben"
|
||||
|
||||
if($Confirmation -cne "PRODUKTIV") {
|
||||
Write-Host "Produktivlauf wurde abgebrochen." -ForegroundColor Yellow
|
||||
return
|
||||
}
|
||||
|
||||
& $ConfigureScript -Apply
|
||||
}
|
||||
else {
|
||||
& $ConfigureScript -DryRun
|
||||
}
|
||||
Reference in New Issue
Block a user