I hear this question a lot in the http://forums.iis.net/, and thanks to Carlos and team's rocking Configuration Editor, figuring this out on your own is a breeze. Here is how you can generate code for ANY IIS7 configuration change, without writing a line yourself.
1) download the IIS7 Administration Pack. What, you don't have it already? You're really missing out on some fantastic tools, including the Configuration Editor. Learn more about the admin pack here http://learn.iis.net/page.aspx/401/using-the-administration-pack/ You can download x86 and x64 from http://www.iis.net/downloads.
2) open "IIS Manager" and click on the "Configuration Editor" feature under the "Management" category:
3) Find the configuration section(s) you want to edit using the drop-down combo box, in this case isapiFilters:
4) use the configuration editor to make your change. In this case, I'm editing a collection, which pops up a collection editor where I can add items to the isapiFilter list by clicking 'add' in the task pane.
5) once you're done making any configuration updates, click on the 'Generate Script' task in the main Config Editor window:
7) Copy and Paste these changes into your own script / code and whoila, you've got sample code for making any IIS7 configuration change.
You may also want to read up on the IIS7 Administration APIs. You can find a lot more information here:
Using Scripts to Automate Management
Managing IIS with the IIS 7.0 PowerShell Provider