attempting fix

This commit is contained in:
Nathan
2025-11-26 18:18:13 -07:00
parent 2aa9061114
commit b61baac09b
5 changed files with 11048 additions and 115 deletions

View File

@@ -8,7 +8,7 @@ param(
[Parameter(Mandatory = $true)]
[string]$PayloadBase64,
[string]$DataRoot = "$env:ProgramData\UnifiedWorkers",
[string]$DataRoot = (Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'UnifiedWorkers'),
[int]$MaxRestarts = 5,
@@ -100,8 +100,11 @@ while ($restartCount -le $MaxRestarts) {
try {
# Initialize worker process
$psi = [System.Diagnostics.ProcessStartInfo]::new()
$psi.FileName = (Get-Command pwsh -ErrorAction SilentlyContinue)?.Source
if (-not $psi.FileName) {
$pwsh = Get-Command pwsh -ErrorAction SilentlyContinue
if ($pwsh) {
$psi.FileName = $pwsh.Source
}
else {
$psi.FileName = (Get-Command powershell -ErrorAction Stop).Source
}