Great little blog describing how to use the built in Configuration Editor to generate PowerShell to configure your IIS Site:

https://blogs.iis.net/jeonghwan/how-to-use-iisadministration-powershell-cmdlets-to-configure-iis-configuration-settings

Remember you need to import the Web Modules to achieve this (installed by default on an IIS server) using the following:

Import-Module WebAdministration