Executing PowerShell Script Performance

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Kahlan Amnell Kahlan Amnell 2 years ago.

  • Author
  • #27470
    Profile photo of Kahlan Amnell
    Kahlan Amnell

    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"


  • #27495
    Profile photo of Garth Maynard
    Garth Maynard

    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.

  • #27505
    Profile photo of Kahlan Amnell
    Kahlan Amnell

    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.

You must be logged in to reply to this topic.