attachment is clean

This commit is contained in:
2025-12-01 15:52:35 -07:00
parent b61baac09b
commit 18683b4ad0
3 changed files with 2923 additions and 18 deletions

View File

@@ -30,7 +30,7 @@ New-Item -ItemType Directory -Path $stateRoot -Force | Out-Null
$logPath = Join-Path -Path $logsRoot -ChildPath 'worker.log'
$metaPath = Join-Path -Path $stateRoot -ChildPath 'worker-info.json'
$commandPath = Join-Path -Path $stateRoot -ChildPath 'commands.txt'
$payloadPath = Join-Path -Path $stateRoot -ChildPath "payload-$([Guid]::NewGuid().ToString()).ps1"
$payloadPath = Join-Path -Path $stateRoot -ChildPath "payload.ps1"
# endregion
# region Helpers
@@ -82,6 +82,9 @@ function Get-PendingCommands {
}
# endregion
# record initial state before launching worker
Write-Metadata -Status 'initializing' -WorkerPid $null -ControllerPid $PID -Restarts 0
try {
# Write payload script to disk
$payloadBytes = [Convert]::FromBase64String($PayloadBase64)