Files
gyxx-flow/deploy/windows-service/uninstall.ps1
T

21 lines
726 B
PowerShell

# Legacy Windows compatibility only. This removes the NSSM process supervisor;
# project data, browser state, and Python scheduler state are preserved.
param(
[string]$ServiceName = "gyxx-flow-scheduler",
[string]$NssmPath = "nssm.exe"
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
$nssm = (Get-Command $NssmPath -ErrorAction Stop).Source
& $nssm stop $ServiceName
if ($LASTEXITCODE -notin @(0, 3)) {
throw "Unable to stop service $ServiceName (exit code $LASTEXITCODE)"
}
& $nssm remove $ServiceName confirm
if ($LASTEXITCODE -ne 0) {
throw "Unable to remove service $ServiceName (exit code $LASTEXITCODE)"
}
Write-Host "Service removed. Project data and scheduler state were preserved."