-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.ps1
More file actions
27 lines (22 loc) · 703 Bytes
/
Copy pathworker.ps1
File metadata and controls
27 lines (22 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Worker Script - Processes a single PDF file
# Called by processor_agent.ps1 for parallel processing
# Usage: pwsh -File worker.ps1 -FilePath "path/to/file.pdf"
param(
[Parameter(Mandatory=$true)]
[string]$FilePath
)
# Get script directory and source the main processor to load all functions
$scriptDir = Split-Path -Parent $PSCommandPath
$mainScript = Join-Path $scriptDir "processor_agent.ps1"
# Set worker mode to prevent main loop from running
$global:WORKER_MODE = $true
# Source the main script to load all functions
. $mainScript
# Now call the processing function
try {
Process-IncomingFile -Path $FilePath
exit 0
} catch {
Write-Error "Worker failed: $_"
exit 1
}