Example
#Add new application pool
function Add-ApplicationPool([string] $AppPoolName)
{
if (( .$env:SystemRoot\System32\inetsrv\appcmd.exe list apppool /Name:$AppPoolName ) -eq $null)
{
.$env:SystemRoot\System32\inetsrv\appcmd.exe add apppool /Name:$AppPoolName -managedRuntimeVersion:v4.0
}
}