08-04-22 12:56 PM
Hello,
I am trying to use AutomateC to export package from Blue Prism (/exportpackage), running it normally works fine. But when I try to redirect output - to read whether the export was successful, either through code (dotnet/python/ps) or on cmd using (> out.txt) it results into error. Is there any workaround other that just not redirecting output.
---> System.IO.IOException: The handle is invalid.
I just want to make sure the exported package is complete package.
Thanks
08-04-22 03:57 PM
11-04-22 09:51 AM
Hi @ewilson,
Thanks for your response.
This is was done outside Blue Prism, as a script/console app to export package using Blue Prism command line (AutomateC - /exportpackage) but kept getting the error whenever I tried reading the output/error. Within Blue Prism I tried using the action you mentioned (adding working dir in code) which resulted in same error and finally I also tried the Utility - Blue Prism from DX exchange which inconviently has no Export Package action, and trying to add and run that action resulted in same error.
I just want to read the output of the command to be sure that package is exported without any errors.
100%: Saved release
Release: 'Test1 - Release 58' exported to file: 'Test1 - Release 58.bprelease'
Thanks,
11-04-22 10:07 PM
2 weeks ago
I know I'm necro'ing this post, but I found the answer in another post, and I confirmed it works for me. I was getting the same classic handle invalid error. I do think it is quite strange for Blue Prism CLI commands to not have been tested against PowerShell, but I wasn't there to see the reason it wasn't so I shall withhold judgement. 😃
The solution is near the bottom of this thread: Exporting a release using command line through Azu... - SS&C Blue Prism Community
I'll just repeat the solution here just in case that link ever breaks. The solution was to use Start-Process from inside of PowerShell. Note that I specifically wanted to use PowerShell.
So, this works in PowerShell for me:
Start-Process -Wait -FilePath "C:\Program Files\Blue Prism Limited\Blue Prism Automate\AutomateC.exe" -ArgumentList '/user "<username>" "<password>"', '/dbconname "<dbconName>"', '/exportpackage "<packageName>"', '/release "<customReleaseFileName>"'
Thanks to @AdityaPradhan for supplying the answer. PowerShell nearly ruined my day, but now I don't have to cry myself to sleep tonight.