continue sheeping

This commit is contained in:
Nathan
2025-11-05 15:18:49 -07:00
parent cd056df109
commit 37bdfcb862
2 changed files with 371 additions and 2 deletions

View File

@@ -30,7 +30,35 @@ if (-not (Test-Path `$exe)) {
`$dir = Split-Path `$exe
Write-Host "Launching SheepIt at `$exe" -ForegroundColor Cyan
`$proc = Start-Process -FilePath `$exe -WorkingDirectory `$dir -WindowStyle Minimized -PassThru
Write-Host "SheepIt started (PID: `$($proc.Id))." -ForegroundColor Green
if (`$proc) {
`$id = `$proc.Id
Write-Host ("SheepIt launcher started (PID: {0})." -f `$id) -ForegroundColor Green
Start-Sleep -Seconds 1
if (Get-Process -Id `$id -ErrorAction SilentlyContinue) {
Write-Host ("SheepIt launcher is still running (PID: {0})." -f `$id) -ForegroundColor Green
}
else {
try {
`$children = Get-CimInstance Win32_Process -Filter "ParentProcessId=`$id"
if (`$children) {
Write-Host "Launcher handed off to:" -ForegroundColor Green
foreach (`$child in `$children) {
Write-Host (" {0} (PID: {1})" -f `$child.Name, `$child.ProcessId) -ForegroundColor Green
}
}
else {
Write-Host "Launcher exited immediately after starting. Check Task Manager for SheepIt/Java processes." -ForegroundColor Yellow
}
}
catch {
Write-Host "Unable to inspect child processes." -ForegroundColor Yellow
}
}
}
else {
Write-Host "SheepIt start confirmed." -ForegroundColor Green
}
exit 0
"@
}