Initial commit – AufmaßCreater v2.35
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Startet PostgreSQL-Dienst falls nicht bereits laufend
|
||||
$svc = Get-Service postgresql-x64-16 -ErrorAction SilentlyContinue
|
||||
if (-not $svc) {
|
||||
Write-Host "PostgreSQL Dienst nicht gefunden. Installiert?" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
if ($svc.Status -ne 'Running') {
|
||||
Write-Host "Starte PostgreSQL..." -ForegroundColor Yellow
|
||||
Start-Process -FilePath "powershell" -ArgumentList "-Command Start-Service postgresql-x64-16" -Verb RunAs -Wait
|
||||
Start-Sleep 2
|
||||
$svc.Refresh()
|
||||
}
|
||||
if ($svc.Status -eq 'Running') {
|
||||
Write-Host "PostgreSQL laeuft." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "PostgreSQL Start fehlgeschlagen." -ForegroundColor Red
|
||||
}
|
||||
Reference in New Issue
Block a user