Magic command to install Asp.Net 4 for IIS 7.5

After creating an ASP.NET web application in Visual Studio, to host it in a freshly installed IIS 7.5, you need to do two things that are not immediately obvious:

  1. Create a new app pool or change the default app pool to target .NET 4 (see IIS->Application Pools).
  2. Run this from the command line:
    %windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -i

MSDN has more info on aspnet_regiis command line options here.
Just putting this on my blog so I can remember this magic command line.