@chv תודה ענקית!
משום מה הוא נתן את (1) כמעט בכל הקבצים (מלבד שניים), זה קרה אחרי שהוא כבר שינה את השמות, כלומר בשלב ב'.
כמו כן, עדיין קיימת הבעיה של תווים לא חוקיים (") ש @OdedDvir הביא למעלה פתרון לגביה.
חוץ מזה פיקס, ואני אסיר תודה, לך וליוסי. אשריכם ישראל.
הנה הפלט:
Test-Path : Illegal characters in path.
At C:\Users\This_user\Desktop\myscript.ps1:15 char:10
+ while (Test-Path -Path $file) {
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (C:\Users\This_u...איר יערי 25.pdf:String) [Test-Path], ArgumentExcepti
on
+ FullyQualifiedErrorId : ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand
Rename-Item : Illegal characters in path.
At C:\Users\This_user\Desktop\myscript.ps1:19 char:8
+ $_ | Rename-Item -NewName "$($text).pdf"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Rename-Item], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.RenameItemCommand
וזה, סתם פיקנטריה:
צריך : The term 'צריך' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\This_user\Desktop\myscript.ps1:21 char:1
+ צריך לשנות בשורה 3 לנתיב לקובץ pdftotext.
+ ~~~~
+ CategoryInfo : ObjectNotFound: (צריך:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
