79662044

Date: 2025-06-11 13:10:50
Score: 0.5
Natty:
Report link

I've been using PowerShell ISE, but I downloaded VS Code instead and installed the PowerShell extension.

This allowed me to view the script variables easily. The $pdf_text variable turned out to be an array instead of a string.

I needed to explicitly join the lines as follows:

foreach ($file in $files) {
    $pdf_text = & $folder_pdftotext_exe -f 1 -l 1 -raw $file -  
    $pdf_text = $pdf_text -join "`n"

The script now works. I fail to understand why the script would have ever worked before. Regardless, problem solved.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: wickyd