FriendsOfMDT / PSD

PowerShell Deployment
MIT License
524 stars 83 forks source link

Slow PowerShell startup in WinPE #42

Closed Hammarskjold closed 4 years ago

Hammarskjold commented 4 years ago

PowerShell takes about 7-8 seconds to start for each script, which very much slows down the process. This is tracked down to being the reason of lack of native (compiled) .Net images. By running ngen against well known assemblies we should be able to greatly speed things up.

This should be kicked off in parallel to any other activity as soon as possible in the WinPE startup.

This could also affect brand new image deployments where the .NET optimizers have not been run (after .Net upgrade or raw images).

Hammarskjold commented 4 years ago

The workaround with calling the native compiled binary after compiling on the fly seems to be good enough.