22 lines
755 B
PowerShell
22 lines
755 B
PowerShell
# PowerShell script to stop JBoss EAP 7.4
|
|
|
|
# Configuration
|
|
$JBOSS_HOME = "C:\Dev2012\BUILDERS\jboss-eap-7.4"
|
|
|
|
Write-Host "Stopping JBoss EAP 7.4..." -ForegroundColor Yellow
|
|
|
|
# Find and stop JBoss process
|
|
$jbossProcess = Get-CimInstance Win32_Process -Filter "Name = 'java.exe'" |
|
|
Where-Object { $_.CommandLine -like "*jboss.home.dir=$JBOSS_HOME*" }
|
|
|
|
if ($jbossProcess) {
|
|
Write-Host "Found JBoss process (PID: $($jbossProcess.ProcessId))" -ForegroundColor Yellow
|
|
Stop-Process -Id $jbossProcess.ProcessId -Force
|
|
Write-Host "JBoss process stopped" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "No JBoss process found running" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Wait a moment to ensure process is fully stopped
|
|
Start-Sleep -Seconds 2
|