jassen/deploy/setup-local.ps1
2026-07-25 18:51:57 +02:00

35 lines
1.1 KiB
PowerShell

# Als Administrator ausführen:
# Rechtsklick PowerShell → „Als Administrator ausführen“, dann:
# Set-ExecutionPolicy -Scope Process Bypass; .\deploy\setup-local.ps1
$ErrorActionPreference = 'Stop'
$hostsPath = 'C:\Windows\System32\drivers\etc\hosts'
$hostsLine4 = '127.0.0.1 jassen.local'
$hostsLine6 = '::1 jassen.local'
$content = Get-Content $hostsPath -Raw
if ($content -notmatch 'jassen\.local') {
Add-Content -Path $hostsPath -Value "`r`n$hostsLine4`r`n$hostsLine6`r`n"
Write-Host "hosts: jassen.local eingetragen"
} else {
Write-Host "hosts: jassen.local war schon da"
}
$apache = Get-Service wampapache64 -ErrorAction SilentlyContinue
if ($apache) {
if ($apache.Status -ne 'Running') {
Start-Service wampapache64
Write-Host "Apache gestartet"
} else {
Restart-Service wampapache64
Write-Host "Apache neu gestartet"
}
} else {
Write-Host "Hinweis: Dienst wampapache64 nicht gefunden — WAMP manuell starten."
}
Write-Host ""
Write-Host "Lokal: http://jassen.local/"
Write-Host "Dev: npm run dev → http://jassen.local:5173/"
Write-Host "Server: https://jassen.pauker.at (siehe deploy/)"