I am loading Powercli snapin in my script. If i execute a script first time in a session it takes more time. When i am executing another script which uses the same snapin ,it takes less time.[I measured the performance using Measure-Command cmdlet]
So i think whenever new session is created , it takes more time to execute the script.
In our case , as users will execute powershell by right clicking the file and run with powershell it will always run in new session. So every time they are facing slowness.
Why executing the powershell script first time in a session takes much time?
Is there any way to avoid this slowness? [I am using Powershell 2.0]