<# .SYNOPSIS Restart ROA2WEB Backend Service .DESCRIPTION Stops and starts the ROA2WEB backend Windows service. .EXAMPLE .\Restart-ROA2WEB.ps1 #> [CmdletBinding()] param( [string]$ServiceName = "ROA2WEB-Backend" ) $ErrorActionPreference = "Stop" Write-Host "`n[*] Restarting ROA2WEB Backend Service..." -ForegroundColor Cyan try { # Stop service Write-Host "`n[*] Stopping service..." -ForegroundColor Yellow & "$PSScriptRoot\Stop-ROA2WEB.ps1" -ServiceName $ServiceName # Wait a moment Start-Sleep -Seconds 2 # Start service Write-Host "`n[*] Starting service..." -ForegroundColor Yellow & "$PSScriptRoot\Start-ROA2WEB.ps1" -ServiceName $ServiceName Write-Host "`n[OK] Service restarted successfully" -ForegroundColor Green exit 0 } catch { Write-Host "`n[ERROR] Failed to restart service: $_" -ForegroundColor Red exit 1 }