About printing and invoke powershell

Greeting to all! Thank you for spending time on reading this post. i was trying to physically print out all files (path: D:\P\Test.pdf), but I have errors when invoking power shell to send the file to printing queue to print out a file, but i just kept getting error, could anyone please help? thanks!


Invoke Power Shell: Unable to cast object of type ‘System.String’ to type ‘System.Management.Automation.PSObject’.
Print_Error1.xaml (6.8 KB)


Invoke Power Shell: The term ‘print /d:\hkps082\IECC_HP_Black D:\P\Test.pdf’ 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.
Print_Error2.xaml (6.6 KB)

The only difference between two xaml above is that whether the “IsScript” optioned is checked or not…Actually someone said the “IsScript” has to be checked. I dont even know why. I am sorry that I barely have any programming knowledge before uipath.
And maybe not using invoke powershell, anything can solve this printing thing (mostly .pdf and .doc/.docx) will do, maybe invoke code? vb.net? please provide the xaml for me to study, thank you in advance!

Besides, I have tried the Printer.Activities package by Pawel Wesolowsky, the sequence completed without any errors, and it worked when printing .xlsx. However when it comes to printing .pdf file, the sequence has no error, and nothing has been sent to the queue.