Function to speed-up the execution of the first PowerCLI cmdlet
February 18, 2012 7 Comments
Last year there was a post on the PowerCLI Team blog called How to speed-up the execution of the first PowerCLI cmdlet. That post showed commands you need to execute to pre-compile some of the PowerCLI code to prevent this from being done in every PowerCLI session.
Running these commands will speed-up the execution of the first PowerCLI cmdlet you run in your session. The blog post was made before PowerCLI 5.0 was released and didn’t show the commands to speed-up PowerCLI 5.0. Later there was a post at the vNugglets blog Speed Up First PowerCLI 5 cmdlet — Precompile XMLSerializers that shows the commands needed for PowerCLI 5.0.
But what happens when PowerCLI 5.1 or 6.0 is released? Of course we can try to find the new commands needed to speed-up PowerCLI every time a new version is released. But would it not be easier if we have a function that will do this for you?
The Install-PowerCLIXmlSerializer function presented in this post will show you a PowerShell function that you need to run once after you install a new PowerCLI version to speed-up the execution of the first cmdlet every time you run PowerCLI. Read more of this post