Example
function Set-ApplicationPool([string] $AppPoolName,[string] $ApplicationName)
{
#Add application pool
Add-ApplicationPool $AppPoolName
#Set application pool
.$env:SystemRoot\System32\inetsrv\appcmd.exe set app /app.name:$ApplicationName /applicationPool:$AppPoolName
}