How to fix TI Process never ends

:warning: PowerShell Script Does Not Finish (Reports Deliver, Script Never Ends)

What you’ll see

  • Your ReportWORQ job runs successfully
  • Reports are delivered
  • The PowerShell script never finishes (the process appears to hang)

How to fix it

Add one line to your PowerShell script.

Step-by-Step Instructions

:one: Open the PowerShell script

Open the script you use to run the ReportWORQ job (for example: RunJob.ps1) in a text editor.

:two: Add this line at the top of the script

Add the line below near the top of the file, before anything else runs:

$PSDefaultParameterValues['Invoke-WebRequest:UseBasicParsing'] = $true

Before and After Example

:cross_mark: Before (script never ends)

# Run ReportWORQ job
Invoke-WebRequest -Uri $url -Method Post -Body $payload

:white_check_mark: After (script completes normally)

# Fix for Windows Server PowerShell behavior
$PSDefaultParameterValues['Invoke-WebRequest:UseBasicParsing'] = $true

# Run ReportWORQ job
Invoke-WebRequest -Uri $url -Method Post -Body $payload

:three: Save and re-run

  • Save the file
  • Run the script again
  • The job will still deliver reports and the script will now finish

That’s it

No other changes are required.

If the script still does not complete after this change, reply to this post and let us know.
This change will be implemented in our April release.