Salve o seguinte em um arquivo Get-AppsInAppPool.ps1 e chame assim:
Get-AppsInAppPool -appPool "My Pool Name"
param([string]$appPool)
import-module webadministration
$apps = (Get-WebConfigurationProperty "/system.applicationHost/sites/site/application['
@applicationPool='$appPool']" "machine/webroot/apphost" -name path).ItemXPath
foreach ($s in $apps) {
$name = $s -replace "\/system.applicationHost\/sites\/site\[\@name='", ""
$name = $name -replace "' and \@id='\d{1,10}'\]\/application\[\@path='", ""
$name = $name -replace "'\]",""
$out += $name + "'n"
}
$out