courseworx/stop-courseworx.ps1

30 lines
No EOL
1.1 KiB
PowerShell
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CourseWorx Stop Script
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " CourseWorx - Stopping Application" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "🔍 Looking for Node.js processes..." -ForegroundColor Yellow
# Get all Node.js processes
$nodeProcesses = Get-Process -Name "node" -ErrorAction SilentlyContinue
if ($nodeProcesses) {
Write-Host "Found $($nodeProcesses.Count) Node.js process(es)" -ForegroundColor Yellow
# Stop all Node.js processes
try {
Stop-Process -Name "node" -Force
Write-Host "✅ All Node.js processes stopped successfully" -ForegroundColor Green
} catch {
Write-Host "❌ Error stopping Node.js processes: $($_.Exception.Message)" -ForegroundColor Red
}
} else {
Write-Host " No Node.js processes were running" -ForegroundColor Cyan
}
Write-Host ""
Write-Host "🎉 CourseWorx has been stopped" -ForegroundColor Green
Write-Host ""
Read-Host "Press Enter to continue"