Reputation: 602
i have a simple if condition as follows...
$site = new-object Microsoft.SharePoint.SPSite($url)
$sitelists = foreach ($web in $site.AllWebs)
{
if ($web -eq "Search")
{
Write-Host "Come in"
}
}
though the site list returns value "Search" the if condition always fails.
Any thoughts?
Upvotes: 0
Views: 3738
Reputation: 126842
I can't test this now but I think you need to compare the Name property?
if ($web.Name -eq "Search")
Upvotes: 1