1 Reply Latest reply on Apr 2, 2018 10:57 AM by Landon Winburn

    Custom Actions - Powershell durations are un-usually long

    Eric.Todor Rookie

      I'm being collecting performance data on all custom actions involving powershell across the environment.   I've been noticing Powershell scripts that should take less than 100ms to execute can take 10000+ ms or more to execute.  There doesn't seem to be a pattern to the behavior but it does affect all of our workstation endpoints randomly.   Has anyone else seen this behavior or experience regarding this.

       

      Thank you,

      --Eric

        • 1. Re: Custom Actions - Powershell durations are un-usually long
          Landon Winburn ITSMMVPGroup

          So here is a test I did with a custom action that wrote hello world to a text file. Simple as it gets. Called it on a process start trigger so both fired at the first time. As you can see powershell is slow as can be. This is due to it having a larger script engine that takes longer to load. You as an admin load powershell and then just run commands after its loaded. That doesn't seem slow as powershell is already loaded however if powershell needs to load and run commands at once it takes a lot more effort than the older and more light weight vbscript.



          There is a good article Helge Klein did a few years ago on the performance impacts of powershell at logon. I'll let you have a read...

           

          https://helgeklein.com/blog/2015/09/performance-footprint-of-powershell-logon-scripts/

           

          All this said I always suggest using native actions and then use vbscript if necessary unless that script engine doesn't offer what your looking for.