Welcome to EMC Consulting Blogs Sign in | Join | Help

Howard van Rooijen's EMC Consulting Blog (2004 - 2010)

This blog has now moved to http://howard.vanrooijen.co.uk/blog - please update your subscriptions if you wish to receive new content.

Speed up PowerShell

Jeffrey Snover just dropped this little gem into the "PowerShell: Creating Manageable Web Services" PDC session. Essentially there is an issue with the declarative nature of PowerShell's internals and how .NET Ngen's assemblies - which resulted in the core PowerShell assemblies not being Ngen'd - which as a side effect makes the PowerShell environment slow. By running this script you Ngen the assemblies and make PowerShell run much faster!

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

Published Thursday, October 30, 2008 5:06 PM by howard.vanrooijen
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Mark.Mann said:

works a treat! sweet!

October 31, 2008 10:47 AM

Leave a Comment


This Blog



This blog has now moved - please visit http://howard.vanrooijen.co.uk/blog for new content!
Add to Live.com
Powered by Community Server (Personal Edition), by Telligent Systems