Author Posts

July 13, 2015 at 4:08 pm

Has anyone noticed before that calling a PS script from a Run .NET activity takes a long time?

The logic below inside the Run .NET activity takes 15-16seconds.

$Script = "C:\test.ps1"

.$Script
UpdateTasks($Tasks)

July 14, 2015 at 6:14 am

Whenever you load a script into the .Net framework, there will be some overhead as it creates a new instance for that script to run in and then reads the file. If performance is an issue, perhaps you can convert it to a module and preload it into your environment. If you are loading the script multiple times in the same script, perhaps you could consider using a workflow script.

July 14, 2015 at 10:50 am

Thank you for your response. My problem is that in reality, the script that I'm calling is determined during runtime, users supply the filepath of the file that we need to execute.