I noticed some performance issues dot sourcing scripts in modules, taking up to a minute to load in all of the files.
I tried to investigate and isolate using procmon on a handful of PCs running WMF5.
The scripts ran instantly on PCS using WMF4, as well as on the WMF5 pcs after uninstalling WMF5.
To test further, I created a file named test.ps1 with the following contents.
$t = "hello" $t
The procmon capture did not account for the time, unless you include the profiling events, which I believe are irrelevant.
PS C:\temp2> Measure-Command { .\test.ps1 } Days : 0 Hours : 0 Minutes : 0 Seconds : 3 Milliseconds : 833 Ticks : 38337812 TotalDays : 4.43724675925926E-05 TotalHours : 0.00106493922222222 TotalMinutes : 0.0638963533333333 TotalSeconds : 3.8337812 TotalMilliseconds : 3833.7812 PS C:\temp2> $PSVersionTable Name Value ---- ----- PSVersion 5.0.10586.117 PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.10586.117 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
On average it takes 3-5 seconds to load a dot sourced a file.
Any ideas on what is causing my performance hit, or how I could further troubleshoot this?