After Updating to powerJobs to 18.0.11 jobs throw error "Could not index into a null array"

Issue

After updating to powerJobs version 18.0.11 or newer some or all jobs throw an error like "Could not index into a null array"

Cause

This is caused by a code breaking change in powerJobs 18.0.11. The job parameters used to be in the $powerJobs.Job.Params collection. This changed so the parameters are all in the new $job object.

Solution 1

You have to replace all occurrences of the old $powerJobs.Job.Params with the new $job object. For example $powerJobs.Job.Params["EntityId"] changes to $Job.EntityId.

  • Navigate to "C:\ProgramData\coolOrange\powerJobs"
  • Open the Setup_job.ps1 and make sure to replace all occurrences in there
  • Also check the ps1 and psm1 files in the jobs and modules folders

Solution 2

Update powerJobs to v19.0 (ChangeLog).

 

 

See Also

$job object (coolOrange wiki)