Question: I am running the following script in Windows 10 via the PowerShell ISE
cd C:\Users\xyz\Desktop\pdfs
$FILES= ls *.pdf
foreach ($f in $FILES) {
"C:\Program Files\xpdf-tools-win-4.01.01\bin32\pdftotext.exe" -enc UTF-8 "$f"
}
I am receiving the following errors
- unexpected token 'enc' in expression or statement
- unexpected token 'UTF-8' in expression or statement
How do I correct those error ?
I suspect, although I am by no means certain, the error is due to incorrect " or ' marks. I have attempted the following change
cd C:\Users\xyz\Desktop\pdfs
$FILES= ls *.pdf
foreach ($f in $FILES) {
"C:\Program Files\xpdf-tools-win-4.01.01\bin32\pdftotext.exe -enc UTF-8 $f"
}
; which surprisingly executes but fails to generate any text files and I am expecting those files to be found in the folder ...\pdfs.