I am trying to get the printer job count from a particular printer with invoke powershell activity.
Script that I am using is -
$Job = Get-PrintJob -PrinterName “abc”
When I run this in the powershell cmd it gives the proper value but when I try to run this with uipath it gives value of 1 when no jobs are running or if more than 1 jobs are running in the print queue and throws null reference exception for only 1 print job in the print queue.
I am storing the script in a text file and passing it as a commandtext to the invoke powershell activity. Type argument is set to Int32.
Let me know if anyone has seen this issue or a way to work around this.