Get WebApplication Name Using GUID
Add-PSSnapin Microsoft.SharePoint.PowerShell
$url = "http://SERVER/sites/MyWebApp"
$site = Get-SPWeb ($url)
foreach ($web in $site.Site.AllWebs)
{
if ($web.Url.StartsWith($url))
{
Write-Host ($web.Name + "|" + $web.Url + "|" + $web.Id)
}
}
Now you will get Name and GUID, just check with GUID corresponding name.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$url = "http://SERVER/sites/MyWebApp"
$site = Get-SPWeb ($url)
foreach ($web in $site.Site.AllWebs)
{
if ($web.Url.StartsWith($url))
{
Write-Host ($web.Name + "|" + $web.Url + "|" + $web.Id)
}
}
Now you will get Name and GUID, just check with GUID corresponding name.