In PowerShell one can clone an existing IIS 7 application pool to a new application pool, retaining all the source pools settings in the new pool. Like this...

```
import-module webadministration
copy IIS:\AppPools\AppPoolTemplate IIS:\AppPools\NewAppPool -force

```

Now I would like to do the same thing in C# using the classes in the Microsoft.Web.Administration namespace. I have browsed the namespace and I cannot find a way to do this easily. There is the MemberwiseClone method that I could call to create a shallow copy of the existing app pool, but I don't know if that would duplicate all the original app pools properties. 

Can anyone help?