Tuesday, July 22, 2008

Speed up V.1 PowerShell Startup Time

As some of you may know PS start up is pretty slow, so I try keep the console open at all times through out my day. That still doesn't solve the speed issue. Yet, there is hope!! There was a post on the Powershell Team Blog a while ago on speeding up the start up time for PS version 1.0
This is the script that they posted to help and boy it sure did. Remember you have to run the command/console as Administrator! Note: This is not needed in V2 of the CTP, as this bug has been fixed in this version.

   1:  Set-Alias ngen @(
   2:  dir (join-path ${env:\windir} "Microsoft.NET\Framework") ngen.exe -recurse |
   3:  sort -descending lastwritetime
   4:  )[0].fullName
   5:  [appdomain]::currentdomain.getassemblies() | %{ngen $_.location}


No comments: