chenyc
2026-04-21 8632fbd73fdb15f22fae9cd36b9ed3e0635360f1
1
2
3
4
5
6
7
8
9
10
11
12
13
param(
  [string]$ServiceName = "JhmGatewayService",
  [string]$NssmPath = "nssm"
)
 
& $NssmPath stop $ServiceName | Out-Null
& $NssmPath remove $ServiceName confirm
 
if ($LASTEXITCODE -ne 0) {
  throw "Failed to remove service via NSSM."
}
 
Write-Host "Service removed: $ServiceName"