I think you have encountered a bug in the IIS Powershell provider. This is just a hunch so someone from the team should respond.
When hosted in an IIS worker process (W3WP.EXE), any consumers of IIS configuration are redirected to an application-pool specific configuraiton file. This config file contains all the config pertinent to the given application pool. It is a security feature (worker processes shouldn't be able to read each other's config). So if you are instantiating the powershell provider in-process, it is using this simpler config file.
This is a bug. The powershell provider should use a new instance of the configuration system and go directly against system32\inetsrv\applicationhost.config. Then it will work (though of course your app will have to run as a user who has access to applicationhost.config -> namely an admin).
As a work around, you can have your application launch a process which has the powershell instance doing your work.
Hope that helps.