The Applications property is defined in the format file, its code is in the iisprovider.format.ps1xml file (in the webadmin module folder).
<TableColumnItem> <ScriptBlock> $pn = $_.Name $sites = get-webconfigurationproperty "/system.applicationHost/sites/site/application[@applicationPool=`'$pn`'and @path='/']/parent::*" machine/webroot/apphost -name name $apps = get-webconfigurationproperty "/system.applicationHost/sites/site/application[@applicationPool=`'$pn`'and @path!='/']" machine/webroot/apphost -name path $arr = @() if ($sites -ne $null) {$arr += $sites} if ($apps -ne $null) {$arr += $apps} if ($arr.Length -gt 0) { $out = "" foreach ($s in $arr) {$out += $s.Value + "`n"} $out.Substring(0, $out.Length - 1) } </ScriptBlock> </TableColumnItem>
You can extract the code and use it outside the format file, just give $ pn the name of the application you want to request. Here is a simplified version of the code:
$pn = 'pool1' $sites = get-webconfigurationproperty "/system.applicationHost/sites/site/application[@applicationPool='$pn' and @path='/']/parent::*" machine/webroot/apphost -name name $apps = get-webconfigurationproperty "/system.applicationHost/sites/site/application[@applicationPool='$pn' and @path!='/']" machine/webroot/apphost -name path $sites,$apps | foreach {$_.value}
source share