Powershell – ConvertTo-WebApplication on IIS

Question:

I’m trying to use powershell to deploy a .NET 4 application to a virtual directory. I use the following code;

When I run this, it appears to work correctly, but on running the site, I get the following error;